npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2024 – Pkg Stats / Ryan Hefner

react-delightful-scroller

v0.1.3

Published

Delightful, virtualized modern infinite scroller πŸŽ‰

Downloads

13

Readme

Welcome to react-delightful-scroller πŸ‘‹

A delightful, virtualized modern infinite scroller πŸŽ‰

Demo and usage

Features

  • Provides delightful infinite scrolling experience for thousands of items
  • Uses batching and virtualization techniques to reduce DOM nodes
  • Handles fixed and dynamic height elements automatically
  • Smooth, aims to achieve 60fps
  • Fully customizable
  • Uses modern web APIs/features
  • Supports vertical scrolling on window (More axis and custom element scroll support soon)
  • Tiny library(Around 7kb gzip)
  • Many more

Component props

| Property | Type | Required? | Description | |:---|:---|:---:|:---| | items | Array | βœ“ | Items to render, can be array of strings, objects or numbers etc. | | itemsCount | Number | βœ“ | Total number of items to render, this can be larger than number of items, in that case a sentinel is added at the bottom(infinite scroll) of rendered items and onFetchMore is triggered when page is scrolled to bottom until the number of items are equal to the itemsCount. | | RenderItem | Component | βœ“ | Component which renders each item. Gets item and index as prop. | | RenderContainer | Component | | Component which renders scroll container. Gets children and forwardRef as prop. | | removeFromDOM | Boolean | | Should remove/add items from DOM while virtualizing and replace with empty node of same height of item. If set to false, items will be set to visibility: hidden; if not visible in the viewport. Default: true. | | root | Function | | A function returning scroll parent node. Scroll listener will be attached to this element(if provided) instead of window. Default: null(indicates window/viewport is the scroll parent). | | averageItemHeight | Number | | Average item height if the items are dynamic. Default: 10. | | itemHeight | Number | | Fixed item height if the items height is fixed. This takes more priority over averageItemHeight if specified. Default: null. | | getItemKey | Function | | Specify custom key prop while rendering each item. function receives item and index as argument. | | wrapperElement | String | | HTML tag used to wrap each rendered item and sentinel. Default: div. | | axis | String | | Scroll axis. Default: y. | | batch | Boolean | | Should batch items(check batchSize) or not. Default: true. | | batchSize | Number | | Batch of items to render at once when virtualizing. Default: 10. | | batchBufferDistance | Number | | Buffer distance of batch from both side of viewport/scrollable node. the batch is only rendered if the batch overlaps with this offset. Default: 250. | | fetchMoreBufferDistance | Number | | Buffer distance to trigger onFetchMore. Default: 500. | | onFetchMore | Function | | Function called when sentinel is near the viewport(when it crosses fetchMoreBufferDistance). The function receives {size, itemsCount, batchSize} as argument. | | RenderLoader | Component | | Component which renders loader when sentinel triggers onFetchMore(basically, more items are loading). Gets items, itemsCount and batchSize as prop. |

Install

This project uses yarn workspaces. You need to have yarn installed.

yarn

Usage

# Develop
yarn watch
# Build and serve
yarn build
yarn serve

TODO

  • [x] Custom container support
  • [ ] Support more axis - x, y-reverse & x-reverse
  • [ ] Scroll restoration
  • [ ] More stories
  • [ ] Test cases

Author

πŸ‘€ Ganapati V S <meetguns.com>

🀝 Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

πŸ“ License

Copyright Β© 2019 Ganapati V S <meetguns.com>. This project is MIT licensed.