Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-dynamic-virtual-scroll

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dynamic-virtual-scroll

React virtual scroll library

  • 1.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.2K
decreased by-22.56%
Maintainers
1
Weekly downloads
 
Created
Source

react-dynamic-virtual-scroll

React component available to implement virtual-scroll at any page without worrying about the dynamic item height.

You can play with the library over here: Codesandbox

Installation

npm install react-dynamic-virtual-scroll

No external dependencies so no need to worry about security and package size.

Usage

  • Import component.

    import VirtualScroll from "react-dynamic-virtual-scroll";
    
  • Add component as follows in your render method:

    <VirtualScroll
        className="List"
        minItemHeight={40}
        totalLength={100}
        renderItem={(rowIndex) => {
            return (
              <div className="List-item">
                <h3>List item: {rowIndex}</h3>
              </div>
            );
        }}
    />
    

Props Table

nametyperequireddefaultdescription
minItemHeightnumbertrueMinimum item height to calculate the placeholder spacing.
totalLengthnumbertrueTotal number of items to be rendered.
renderItem(rowIndex) => React.ReactNodetrueCallback to render items for specified index values. 0-indexed
lengthnumber30Total number of items to be rendered in the dom.
buffernumber10Total number of items to be rendered in the dom before and after your required dom items.

Keywords

FAQs

Package last updated on 18 Feb 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc