React components for efficiently rendering large lists and tabular data
Installations
npm install react-virtualized
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
20.2.0
NPM Version
9.6.6
Score
92.2
Supply Chain
96.1
Quality
86.6
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Languages
JavaScript (97.3%)
CSS (1.67%)
HTML (1.03%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
346,257,281
Last Day
188,187
Last Week
832,024
Last Month
3,603,725
Last Year
58,952,188
GitHub Statistics
26,569 Stars
1,994 Commits
3,066 Forks
226 Watching
25 Branches
201 Contributors
Bundle Size
122.93 kB
Minified
27.94 kB
Minified + Gzipped
Package Meta Information
Latest Version
9.22.6
Package Id
react-virtualized@9.22.6
Unpacked Size
2.14 MB
Size
285.73 kB
File Count
253
NPM Version
9.6.6
Node Version
20.2.0
Publised On
20 Jan 2025
Total Downloads
Cumulative downloads
Total Downloads
346,257,281
Last day
-4.6%
188,187
Compared to previous day
Last week
-13.1%
832,024
Compared to previous week
Last month
-2%
3,603,725
Compared to previous month
Last year
-47.7%
58,952,188
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
67
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.
1npm install react-virtualized --save
ES6, CommonJS, and UMD builds are available with each distribution. For example:
1// Most of react-virtualized's styles are functional (eg position, size). 2// Functional styles are applied directly to DOM elements. 3// The Table component ships with a few presentational styles as well. 4// They are optional, but if you want them you will need to also import the CSS file. 5// This only needs to be done once; probably during your application's bootstrapping process. 6import 'react-virtualized/styles.css'; 7 8// You can import any component you want as a named export from 'react-virtualized', eg 9import {Column, Table} from 'react-virtualized'; 10 11// But if you only use a few react-virtualized components, 12// And you're concerned about increasing your application's bundle size, 13// You can directly import only the components you need, like so: 14import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer'; 15import 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:
1// Partial webpack.config.js 2{ 3 alias: { 4 'react-virtualized/List': 'react-virtualized/dist/es/List', 5 }, 6 ...rest 7}
Then you can just import like so:
1import List from 'react-virtualized/List'; 2 3// Now you can use <List {...props} />
You can also use a global-friendly UMD build:
1<link rel="stylesheet" href="path-to-react-virtualized/styles.css" /> 2<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:
1<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 Grid
s are updated.
Documentation
API documentation available here.
There are also a couple of how-to guides:
- Customizing classes and styles
- Displaying items in reverse order
- Using AutoSizer
- Creating an infinite-loading list
- Natural sort Table
- Sorting a Table by multiple columns
Examples
Examples for each component can be seen in the documentation.
Here are some online demos of each component:
- ArrowKeyStepper
- AutoSizer
- CellMeasurer
- Collection
- ColumnSizer
- Grid
- InfiniteLoader
- List
- Masonry
- MultiGrid
- ScrollSync
- Table
- WindowScroller
And here are some "recipe" type demos:
- Table with resizable (drag and drop) columns
- Collapsable tree view
- Full-page grid (spreadsheet)
- Dynamic cell measuring
- Cell hover effects
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.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
4 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 4
Reason
Found 9/26 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/stale.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/stale.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/bvaughn/react-virtualized/stale.yml/master?enable=pin
- Info: 0 out of 1 GitHub-owned GitHubAction dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 17 are checked with a SAST tool
Reason
24 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-8mmm-9v2q-x3f9
- Warn: Project is vulnerable to: GHSA-pfq8-rq6v-vf5m
- Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5
- Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp
- Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq
- Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr
- Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765
- Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g
- Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
3.2
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to react-virtualized
@react-native/virtualized-lists
Virtualized lists for React Native.
react-virtualized-auto-sizer
Standalone version of the AutoSizer component from react-virtualized
@types/react-virtualized
TypeScript definitions for react-virtualized
@types/react-virtualized-auto-sizer
TypeScript definitions for react-virtualized-auto-sizer