react-virtualized vs react-infinite vs react-infinite-scroll-component vs react-window
React Infinite Scrolling Libraries
react-virtualizedreact-infinitereact-infinite-scroll-componentreact-windowSimilar Packages:

React Infinite Scrolling Libraries

Infinite scrolling libraries for React are designed to enhance user experience by loading content dynamically as the user scrolls down the page. This technique helps in improving performance and reducing load times by fetching data in smaller chunks rather than loading everything at once. These libraries provide various features such as virtualization, scrolling detection, and customizable loading indicators, making it easier for developers to implement infinite scrolling in their applications.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
react-virtualized1,528,77527,0732.24 MB0a year agoMIT
react-infinite02,687243 kB102-BSD-3-Clause
react-infinite-scroll-component03,068199 kB2026 hours agoMIT
react-window017,144209 kB12 months agoMIT

Feature Comparison: react-virtualized vs react-infinite vs react-infinite-scroll-component vs react-window

Performance Optimization

  • react-virtualized:

    react-virtualized excels in performance optimization, rendering only the visible items in a list or table, which is crucial for applications dealing with large datasets. It minimizes DOM updates and improves rendering speed significantly.

  • react-infinite:

    react-infinite provides basic infinite scrolling capabilities but lacks advanced optimizations for rendering large datasets, making it less suitable for performance-critical applications.

  • react-infinite-scroll-component:

    This package offers a good balance of performance and ease of use, allowing for smooth scrolling experiences without heavy overhead, suitable for most applications.

  • react-window:

    react-window is designed for high performance with a minimal footprint, focusing on rendering only the visible items efficiently, making it an excellent choice for large lists.

Ease of Use

  • react-virtualized:

    While powerful, react-virtualized has a steeper learning curve due to its extensive features and configuration options, which may require more time to master.

  • react-infinite:

    react-infinite is straightforward to implement, requiring minimal configuration, making it suitable for developers looking for a quick solution without complex setup.

  • react-infinite-scroll-component:

    This library is user-friendly and flexible, providing a simple API that allows for easy integration into existing projects, making it ideal for developers of all skill levels.

  • react-window:

    react-window is designed to be simple and intuitive, making it easy to use for developers who need a quick solution for rendering large lists without the complexity of react-virtualized.

Feature Set

  • react-virtualized:

    react-virtualized comes with a comprehensive set of features for virtualization, including windowing, dynamic row heights, and more, making it suitable for complex data presentations.

  • react-infinite:

    react-infinite offers basic infinite scrolling features but lacks advanced functionalities such as virtualization or customizable loading states, which may limit its use in complex applications.

  • react-infinite-scroll-component:

    This package provides a rich feature set, including support for both scroll and touch events, customizable loading indicators, and easy integration with existing components.

  • react-window:

    react-window focuses on providing essential features for virtualization in a lightweight manner, making it easy to implement while still offering good performance.

Community and Support

  • react-virtualized:

    With a large user base and extensive documentation, react-virtualized offers robust community support and a wealth of resources for troubleshooting and implementation.

  • react-infinite:

    react-infinite has a smaller community and less frequent updates, which may affect long-term support and the availability of resources.

  • react-infinite-scroll-component:

    This library has a growing community and active maintenance, providing good support and resources for developers.

  • react-window:

    react-window, being a lightweight alternative to react-virtualized, has a supportive community and is well-documented, making it easy for developers to find help and examples.

Customization

  • react-virtualized:

    react-virtualized provides extensive customization capabilities, allowing developers to define custom renderers for rows and cells, making it highly adaptable for various use cases.

  • react-infinite:

    react-infinite offers limited customization options, which may restrict developers looking for specific behaviors or styles in their infinite scrolling implementation.

  • react-infinite-scroll-component:

    This library allows for a high degree of customization, enabling developers to tailor the loading indicators and scrolling behavior to fit their application's needs.

  • react-window:

    react-window supports basic customization options, focusing on simplicity while still allowing developers to adjust styles and behaviors as needed.

How to Choose: react-virtualized vs react-infinite vs react-infinite-scroll-component vs react-window

  • react-virtualized:

    Select react-virtualized when you need advanced performance optimizations for rendering large lists or tables. It provides a comprehensive set of components for virtualization, allowing you to render only the visible items in the viewport, which can significantly improve performance.

  • react-infinite:

    Choose react-infinite if you need a straightforward solution for infinite scrolling with basic features and don't require advanced virtualization or performance optimizations.

  • react-infinite-scroll-component:

    Opt for react-infinite-scroll-component if you want a simple and flexible implementation of infinite scrolling that supports both scroll and touch events, making it suitable for mobile and desktop applications.

  • react-window:

    Choose react-window for a lightweight alternative to react-virtualized, focusing on simplicity and performance. It is ideal for rendering large lists with minimal overhead and is easier to integrate into existing projects.

README for react-virtualized

React virtualized

React components for efficiently rendering large lists and tabular data. Check out the demo for some examples.

If you like this project, 🎉 become a sponsor or ☕ buy me a coffee

Sponsors

The following wonderful companies have sponsored react-virtualized:

Learn more about becoming a sponsor!

A word about react-window

If you're considering adding react-virtualized to a project, take a look at react-window as a possible lighter-weight alternative. Learn more about how the two libraries compare here.

Getting started

Install react-virtualized using npm.

npm install react-virtualized --save

ES6, CommonJS, and UMD builds are available with each distribution. For example:

// Most of react-virtualized's styles are functional (eg position, size).
// Functional styles are applied directly to DOM elements.
// The Table component ships with a few presentational styles as well.
// They are optional, but if you want them you will need to also import the CSS file.
// This only needs to be done once; probably during your application's bootstrapping process.
import 'react-virtualized/styles.css';

// You can import any component you want as a named export from 'react-virtualized', eg
import {Column, Table} from 'react-virtualized';

// But if you only use a few react-virtualized components,
// And you're concerned about increasing your application's bundle size,
// You can directly import only the components you need, like so:
import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer';
import List from 'react-virtualized/dist/commonjs/List';

Note webpack 4 makes this optimization itself, see the documentation.

If the above syntax looks too cumbersome, or you import react-virtualized components from a lot of places, you can also configure a Webpack alias. For example:

// Partial webpack.config.js
{
  alias: {
    'react-virtualized/List': 'react-virtualized/dist/es/List',
  },
  ...rest
}

Then you can just import like so:

import List from 'react-virtualized/List';

// Now you can use <List {...props} />

You can also use a global-friendly UMD build:

<link rel="stylesheet" href="path-to-react-virtualized/styles.css" />
<script src="path-to-react-virtualized/dist/umd/react-virtualized.js"></script>

Now you're ready to start using the components. You can learn more about which components react-virtualized has to offer below.

Dependencies

React Virtualized has very few dependencies and most are managed by NPM automatically. However the following peer dependencies must be specified by your project in order to avoid version conflicts: react, react-dom. NPM will not automatically install these for you but it will show you a warning message with instructions on how to install them.

Pure Components

By default all react-virtualized components use shallowCompare to avoid re-rendering unless props or state has changed. This occasionally confuses users when a collection's data changes (eg ['a','b','c'] => ['d','e','f']) but props do not (eg array.length).

The solution to this is to let react-virtualized know that something external has changed. This can be done a couple of different ways.

Pass-thru props

The shallowCompare method will detect changes to any props, even if they aren't declared as propTypes. This means you can also pass through additional properties that affect cell rendering to ensure changes are detected. For example, if you're using List to render a list of items that may be re-sorted after initial render- react-virtualized would not normally detect the sort operation because none of the properties it deals with change. However you can pass through the additional sort property to trigger a re-render. For example:

<List {...listProps} sortBy={sortBy} />
Public methods

Grid and Collection components can be forcefully re-rendered using forceUpdate. For Table and List, you'll need to call forceUpdateGrid to ensure that the inner Grid is also updated. For MultiGrid, you'll need to call forceUpdateGrids to ensure that the inner Grids are updated.

Documentation

API documentation available here.

There are also a couple of how-to guides:

Examples

Examples for each component can be seen in the documentation.

Here are some online demos of each component:

And here are some "recipe" type demos:

Supported Browsers

react-virtualized aims to support all evergreen browsers and recent mobile browsers for iOS and Android. IE 9+ is also supported (although IE 9 will require some user-defined, custom CSS since flexbox layout is not supported).

If you find a browser-specific problem, please report it along with a repro case. The easiest way to do this is probably by forking this Plunker.

Friends

Here are some great components built on top of react-virtualized:

  • react-infinite-calendar: Infinite scrolling date-picker with localization, themes, keyboard support, and more
  • react-sortable-hoc: Higher-order components to turn any list into an animated, touch-friendly, sortable list
  • react-sortable-tree: Drag-and-drop sortable representation of hierarchical data
  • react-virtualized-checkbox: Checkbox group component with virtualization for large number of options
  • react-virtualized-select: Drop-down menu for React with windowing to support large numbers of options.
  • react-virtualized-tree: A reactive tree component that aims to render large sets of tree structured data in an elegant and performant way
  • react-timeline-9000: A calendar timeline component that is capable of displaying and interacting with a large number of items

Contributions

Use GitHub issues for requests.

I actively welcome pull requests; learn how to contribute.

Changelog

Changes are tracked in the changelog.

License

react-virtualized is available under the MIT License.