<img src="https://react-window.vercel.app/og.png" alt="react-window logo" width="400" height="210" />
react-window is a React library that implements windowing (virtualization) to render only the visible portion of large datasets. Instead of mounting thousands of DOM nodes for a long list, it renders a small subset that fits in the viewport and recycles components as you scroll. This keeps memory usage low and frame rates high, even with tens of thousands of items.
Created by Brian Vaughn (the original author of react-virtualized), react-window is a rewrite focused on minimal API surface and smaller bundle size. It strips away the extra features of react-virtualized to provide just the core windowing primitives: fixed and variable size lists, plus grid layouts. The library is production-ready and widely adopted, with over 4 million weekly downloads as of 2025.
Developers choose react-window when rendering performance matters and the dataset is too large for naive rendering. Common scenarios include chat message histories, data tables with hundreds of rows, infinite feeds, and any scrollable UI where mounting all items would cause jank. It integrates cleanly with existing React patterns—items are just components, and you pass data through standard props.
The library requires external packages for features like infinite loading (react-window-infinite-loader) or responsive sizing (react-virtualized-auto-sizer). This modular approach keeps the core lightweight but means you'll compose multiple packages for advanced use cases. If you need a batteries-included solution with built-in infinite loaders and complex table support, consider react-virtualized instead, though it comes with a larger bundle.
import React from 'react';
import { FixedSizeList as List } from 'react-window';
const generateItems = (count) =>
Array.from({ length: count }, (_, i) => ({
id: i,
title: `Item ${i + 1}`,
description: `This is the description for item number ${i + 1}`
}));
const Row = ({ index, style, data }) => {
const item = data[index];
return (
<div style={{
...style,
borderBottom: '1px solid #eee',
padding: '12px',
display: 'flex',
flexDirection: 'column'
}}>
<strong>{item.title}</strong>
<span style={{ fontSize: '14px', color: '#666' }}>
{item.description}
</span>
</div>
);
};
const VirtualizedList = () => {
const items = generateItems(10000);
return (
<List
height={600}
itemCount={items.length}
itemSize={70}
width="100%"
itemData={items}
>
{Row}
</List>
);
};
export default VirtualizedList;Large data tables: Render financial datasets, log viewers, or admin dashboards with 10,000+ rows without freezing the UI. Only visible rows exist in the DOM, so sorting and filtering remain responsive.
Chat applications: Display message histories spanning thousands of messages. As users scroll up through old messages, react-window mounts only the visible slice, keeping memory constant regardless of total message count.
E-commerce product grids: Show catalogs with hundreds of products in a scrollable grid. Variable-size support handles items with different aspect ratios or dynamic content like user reviews.
Dropdown menus with search: Render filterable dropdowns containing thousands of options (like country lists, user directories, or tag selectors) without lag during typing or scrolling.
Code editors and log viewers: Display large files or streaming logs line-by-line. Virtualization prevents the browser from choking on files with 50,000+ lines while maintaining smooth scrolling and search.
npm install react-windowpnpm add react-windowbun add react-window