react-virtualized vs react-virtual vs react-window
Virtualizing Large Lists in React Applications
react-virtualizedreact-virtualreact-windowSimilar Packages:

Virtualizing Large Lists in React Applications

react-virtualized, react-window, and react-virtual are libraries designed to handle rendering large datasets efficiently in React. They use a technique called windowing or virtualization, which only renders the items currently visible in the viewport. This approach drastically reduces DOM node count and improves scrolling performance. While react-virtualized is the legacy option with many built-in components, react-window is its lighter, modern successor focused on core windowing. react-virtual (now part of TanStack) offers a headless, hook-based approach that works across multiple frameworks.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
react-virtualized1,232,00927,0712.24 MB02 years agoMIT
react-virtual436,4287,113158 kB115-MIT
react-window017,207216 kB114 days agoMIT

Virtualizing Large Lists in React Applications

When building data-heavy dashboards or feeds, rendering thousands of DOM nodes at once will slow down your application. react-virtualized, react-window, and react-virtual solve this by only rendering the items currently visible on the screen. While they share the same goal, their architectures and maintenance status differ significantly. Let's compare how they handle common engineering challenges.

šŸ—ļø Architecture & API Style: Components vs Hooks

react-virtualized relies on heavy class-based components.

  • You import specific components like <List> or <Grid>.
  • Props are passed directly to configure behavior.
  • Less flexible for custom DOM structures.
// react-virtualized: Component-based
import { List } from 'react-virtualized';

<List
  width={600}
  height={400}
  rowCount={1000}
  rowHeight={50}
  rowRenderer={({ index, style }) => (
    <div style={style}>Row {index}</div>
  )}
/>

react-window uses function components with a render prop pattern.

  • You wrap your items in <FixedSizeList> or <VariableSizeList>.
  • The child function provides index and style.
  • Cleaner API but still component-bound.
// react-window: Component with render prop
import { FixedSizeList } from 'react-window';

<FixedSizeList
  width={600}
  height={400}
  itemCount={1000}
  itemSize={50}
>
  {({ index, style }) => (
    <div style={style}>Row {index}</div>
  )}
</FixedSizeList>

react-virtual provides a headless hook.

  • You call useVirtualizer to get virtual items.
  • You map over the items and apply styles manually.
  • Maximum flexibility for custom layouts.
// react-virtual: Hook-based
import { useVirtualizer } from '@tanstack/react-virtual';

const virtualizer = useVirtualizer({
  count: 1000,
  getScrollElement: () => parentRef.current,
  estimateSize: () => 50,
});

return (
  <div ref={parentRef} style={{ height: '400px', overflow: 'auto' }}>
    <div style={{ height: virtualizer.getTotalSize() }}>
      {virtualizer.getVirtualItems().map((virtualItem) => (
        <div key={virtualItem.key} style={{ transform: `translateY(${virtualItem.start}px)` }}>
          Row {virtualItem.index}
        </div>
      ))}
    </div>
  </div>
);

šŸ“ Handling Container Sizes: Built-in vs External

Resizing the virtual list when the window or container changes is a common requirement.

react-virtualized includes <AutoSizer> out of the box.

  • Wraps the list and passes width/height props.
  • Convenient but adds bundle weight even if unused elsewhere.
// react-virtualized: Built-in AutoSizer
import { List, AutoSizer } from 'react-virtualized';

<AutoSizer>
  {({ height, width }) => (
    <List
      width={width}
      height={height}
      rowCount={1000}
      rowHeight={50}
      rowRenderer={({ index, style }) => (
        <div style={style}>Row {index}</div>
      )}
    />
  )}
</AutoSizer>

react-window requires a separate package.

  • You must install react-virtualized-auto-sizer.
  • Keeps the core library lightweight.
  • API is nearly identical to the legacy version.
// react-window: External AutoSizer
import { FixedSizeList } from 'react-window';
import AutoSizer from 'react-virtualized-auto-sizer';

<AutoSizer>
  {({ height, width }) => (
    <FixedSizeList
      width={width}
      height={height}
      itemCount={1000}
      itemSize={50}
    >
      {({ index, style }) => (
        <div style={style}>Row {index}</div>
      )}
    </FixedSizeList>
  )}
</AutoSizer>

react-virtual handles resizing via observers.

  • The hook uses ResizeObserver internally.
  • No extra wrapper component needed.
  • You just need a ref on the scrollable parent.
// react-virtual: Observer-based
import { useVirtualizer } from '@tanstack/react-virtual';

const parentRef = useRef(null);

const virtualizer = useVirtualizer({
  count: 1000,
  getScrollElement: () => parentRef.current,
  estimateSize: () => 50,
  // ResizeObserver is handled internally
});

return (
  <div ref={parentRef} style={{ overflow: 'auto' }}>
    {/* Virtual items rendered here */}
  </div>
);

šŸ› ļø Maintenance & Future Proofing

Long-term support is critical when choosing infrastructure libraries.

react-virtualized is in maintenance mode.

  • The original author recommends react-window for new work.
  • Bugs are fixed, but no new features are added.
  • Larger bundle size due to legacy code.
// react-virtualized: Legacy status
// āš ļø Not recommended for new projects
import { List } from 'react-virtualized';

react-window is actively maintained.

  • Designed as the modern replacement for react-virtualized.
  • Stable API with focused scope.
  • Best choice for standard React lists and grids.
// react-window: Active standard
// āœ… Recommended for React-specific projects
import { FixedSizeList } from 'react-window';

react-virtual is part of the TanStack ecosystem.

  • Actively developed alongside TanStack Table and Query.
  • Framework-neutral (works with Solid, Vue, Svelte).
  • Best choice for custom needs or multi-framework teams.
// react-virtual: Modern headless
// āœ… Recommended for custom layouts or non-React frameworks
import { useVirtualizer } from '@tanstack/react-virtual';

šŸ¤ Similarities: Shared Ground Between Libraries

Despite their differences, all three libraries solve the same core problem using similar underlying math.

1. šŸ“‰ DOM Reduction

  • All three only render visible rows.
  • Keeps the DOM light even with 10,000+ items.
// All libraries: Render only visible items
// Instead of 1000 divs, only ~10 are in the DOM

2. šŸ“ Absolute Positioning

  • Items are positioned using transform or top/left.
  • Ensures smooth scrolling without layout thrashing.
// All libraries: Use inline styles for position
style={{ transform: `translateY(${offset}px)` }}

3. šŸ”„ Scroll Event Listening

  • All attach listeners to the scroll container.
  • Calculate visible range based on scroll offset.
// All libraries: Listen to scroll events
// Internal logic calculates startIndex and endIndex

šŸ“Š Summary: Key Differences

Featurereact-virtualizedreact-windowreact-virtual
API Style🧱 Class Componentsāš›ļø Function ComponentsšŸŖ Hooks (Headless)
Bundle Size🐘 Heavy🪶 Light🪶 Light
AutoSizerāœ… Built-ināŒ Separate Packageāœ… Internal Observer
Maintenanceāš ļø Legacyāœ… Activeāœ… Active
Frameworkāš›ļø React Onlyāš›ļø React Only🌐 Framework Neutral

šŸ’” The Big Picture

react-virtualized is the legacy option šŸ•°ļø — avoid it for new work unless you are stuck maintaining old code. It has too much weight for modern apps.

react-window is the standard choice šŸ† for React projects — it is light, stable, and does exactly what most teams need without extra complexity.

react-virtual is the flexible choice šŸ› ļø for custom needs — use it if you need headless logic, custom layouts, or support for frameworks beyond React.

Final Thought: For most React developers, react-window offers the best balance of performance and ease of use. If you need more control or framework neutrality, react-virtual is the modern alternative.

How to Choose: react-virtualized vs react-virtual vs react-window

  • react-virtualized:

    Choose react-virtualized only if you are maintaining an existing codebase that already depends on it. It includes many built-in components like Grid and Table, but it is heavier and no longer receives active feature development. For new projects, this package is considered legacy and should be avoided in favor of lighter alternatives.

  • react-virtual:

    Choose react-virtual if you want a headless solution that gives you full control over rendering logic. It uses hooks instead of components, making it flexible for custom layouts or non-React frameworks like Solid or Vue. This option requires more setup but avoids locking you into specific component structures.

  • react-window:

    Choose react-window if you need a reliable, React-specific solution for lists or grids with minimal overhead. It is the recommended successor to react-virtualized by the same author and offers better performance for standard use cases. You will need to pair it with react-virtualized-auto-sizer for dynamic container sizing.

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.