
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
infinite-section
Advanced tools
Virtualized window-based infinite-scrolling for sites and apps that load content in 'sections', that don't have a pre-determined width or height. Outperforms react-virtualized, and incredibly light-weight. Based on Facebook's infinite scrolling mechanism.
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
Socket optimized override available
npm i infinite-section
Virtualized scroll libraries are often built to handle tabular data - and can do an almost infinite number of table rows and columns fast - but fall apart when your data is less 'structured', or requires full-window scrolling. This library handles those use cases - where you're building social feeds, or product lists, or a news site, or anywhere you've got data that loads in without you being able to know its visual width and height in advance. It's based on an interpretation of how sites like Facebook, Twitter, and Forbes deal with infinite scrolling on section-based data. This method is great for accessibility and is super-easy to implement.
Function Name | Description | Expects | Returns |
---|---|---|---|
useInfiniteSections (Hook) | Provide this hook with the amount of nodes currently available (i.e. nodes.length if working on an array) and a callback function to load more nodes. It'll work out the current view behind the scenes and choose what to render accordingly. | nodesAvailable: The amount of nodes currently available. loadMoreCallback (optional): give the hook a function to call when more nodes need to be fetched (i.e. from your server). | { currentView, setCurrentView, windowSize }: provide this object to the InfiniteSection component as props. |
InfiniteSection (Component) | The component that'll wrap all your section-based data. You'll probably use this like {nodes.map((node, viewIndex) => <InfiniteSection currentView={currentView} setCurrentView={setCurrentView} viewIndex={viewIndex} windowSize={windowSize}>{node.data}</InfiniteSection>)} . | children: Your React children to render. currentView, setCurrentView, windowSize: variables from useInfiniteSections hook. viewIndex: the index of the view within the array of your nodes. Probably the same as whatever you're passing for key. | React element containing your Node's children. |
FAQs
Virtualized window-based infinite-scrolling for sites and apps that load content in 'sections', that don't have a pre-determined width or height. Outperforms react-virtualized, and incredibly light-weight. Based on Facebook's infinite scrolling mechanism.
The npm package infinite-section receives a total of 4 weekly downloads. As such, infinite-section popularity was classified as not popular.
We found that infinite-section demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.