
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
react-virtualized
Advanced tools
React components for efficiently rendering large, scrollable lists and tabular data
Install react-virtualized using npm.
npm install react-virtualized --save
API documentation available here.
Below is a simple VirtualScroll example. Each row in the virtualized list is rendered through the use of a rowRenderer function for performance reasons. This function must return an element with a unique key and must fit within the specified rowHeight.
Note that it is very important that rows do not have vertical overflow. This will make scrolling the list difficult (as individual items will intercept the scroll events). For this reason it is recommended that your rows use a style like overflow-y: hidden.)
import React from 'react';
import ReactDOM from 'react-dom';
import { VirtualScroll } from 'react-virtualized';
// List data as an array of strings
const list = [
'Brian Vaughn'
// And so on...
];
// Render your list
ReactDOM.render(
<VirtualScroll
width={300}
height={300}
rowsCount={list.length}
rowHeight={20}
rowRenderer={
index => (
<div key={index}>
{list[index]}
</div>
)
}
/>,
document.getElementById('example')
);
Below is a very basic FlexTable example. This table has only 2 columns, each containing a simple string. Both have a fixed width and neither is sortable. See here for a more full-featured example including custom cell renderers, sortable headers, and more.
import React from 'react';
import ReactDOM from 'react-dom';
import { FlexTable, FlexColumn } from 'react-virtualized';
// Table data as a array of objects
const list = [
{ name: 'Brian Vaughn', description: 'Software engineer' }
// And so on...
];
// Render your table
ReactDOM.render(
<FlexTable
width={300}
height={300}
headerHeight={20}
rowHeight={30}
rowsCount={list.length}
rowGetter={index => list[index]}
>
<FlexColumn
label='Name'
dataKey='name'
width={100}
/>
<FlexColumn
width={200}
label='Description'
dataKey='description'
/>
</FlexTable>,
document.getElementById('example')
);
Use GitHub issues for requests.
I actively welcome pull requests; learn how to contribute.
Changes are tracked in the changelog.
react-virtualized is available under the MIT License.
2.6.2
Added check for undefined document before accessing attachEvent to avoid causing problems with server-side rendering.
React-window is a complete rewrite of react-virtualized by the same author. It offers similar functionality but with a smaller and faster core. It's designed to be more approachable and easier to use than react-virtualized.
React-infinite is another package for rendering large lists of elements within a scrolling container. It differs from react-virtualized in its API and the way it handles infinite loading, but it also aims to provide efficient rendering for large lists.
React-virtuoso is a virtual list component with a simple API that supports variable-sized items and sticky headers. It provides a different approach to virtualization compared to react-virtualized, focusing on simplicity and automatic handling of item heights.
React-list is a versatile infinite scroll React component. It offers several modes for rendering lists, including simple, variable, and uniform heights. It's a simpler alternative to react-virtualized with fewer features but can be easier to integrate in some cases.
FAQs
React components for efficiently rendering large, scrollable lists and tabular data
The npm package react-virtualized receives a total of 1,101,280 weekly downloads. As such, react-virtualized popularity was classified as popular.
We found that react-virtualized demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.