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

sodium-infinite-scroller

v1.0.2

Published

<p align="center"> <a href="https://github.com/sohamsshah/sodium-infinite-scroller" rel="noopener" target="_blank"><img width="150" src="https://i.imgur.com/BaN22lK.png" alt="sodium infinite scroller Logo"></a></p> </p>

Downloads

2

Readme


A simple, zero-dependency and awesome React Infinite ♾ Scrolling Component based on Intersection Observer API. Works perfectly fine with almost null-hassle and lets you implement infinite scrolling in your web app on the fly! Powered by Vite.js ⚡

⬇ Installation

// using npm
npm i sodium-infinite-scroller

//or you prefer yarn
yarn add sodium-infinite-scroller

🏄‍♂️ Usage

Importing the package

// in ES6
import InfiniteScroll from "sodium-infinite-scroller";
// or commonjs
var InfiniteScroll = require("sodium-infinite-scroller");

Using the Infinite Scroll Component

<InfiniteScroll
  dataLength={images.length}
  hasMore={hasMore}
  loadMore={getMoreImages}
  loader={<Loader />}
  threshold={VISIBILITY_THRESHOLD}
>
  {contentToBeInfinitelyScrolled}
</InfiniteScroll>

Prop Definition

| prop | type | description | | ---------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | dataLength | number | Denotes the length of the data which is loaded on every call loadMore() function call. | | hasMore | bool | Denotes if there is more data to be loaded. | | loadMore | function | Takes the function that is to be called to fetch more data for infinite scrolling. | | threshold | number | Denotes the visibility threshold value of the element that is being observed by the Intersection Observer API. The Value is between 0 and 1; and it represents the percentage of the element visible. | | loader | node | Takes a Node Element(can be a simple HTML element node or even a React Component) to represent the loading state. | | endContent | node | Takes a Node Element(can be a simple HTML element node or even a React Component) to show the end content when data is loaded. | | children | node (list) | The Data Items on while you want to enable infinite scrolling functionality. |

🛠️ Spinning Up Development Environment

  1. Clone the repository
git clone https://github.com/sohamsshah/sodium-infinite-scroller.git
  1. Change the working directory
cd sodium-infinite-scroller
  1. Install dependencies
yarn
  1. Test working of the package
yarn run dev

You are all set! Open localhost:3000 to see the app.

  1. Make changes and build the package
yarn build

Check if the build is successful and raise a PR with the proposed changes.

💖 We love Contributions

  • Sodium Infinite Scroller is truly Open Source. Any sort of contribution to this project are highly appreciated. Create a branch, add commits, and open a pull request.

  • Please read CONTRIBUTING for details on our CODE OF CONDUCT, and the process for submitting pull requests to Sodium Infinite Scroller.

🛡️ License

This project is licensed under the MIT License - see the LICENSE file for details.


👨‍💻 Author

👤 Soham Shah


O Stargazer✨! Can you ⭐️ this too?