# @rc-component/virtual-list

> Virtual scrolling list component for React.

Latest version **1.5.2** (published 2026-09-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rc-component/virtual-list
pnpm add @rc-component/virtual-list
yarn add @rc-component/virtual-list
bun add @rc-component/virtual-list
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.5.2 |
| Published | 2026-09-17 |
| First published | 2025-12-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8.x |
| Dependencies | 4 |
| Unpacked size | 148 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 814 |
| Author | smith3816@gmail.com |
| Maintainers | zombiej, afc163, madccc, peachscript, chenshuai2144 |
| Keywords | react, react-component, virtual-list |

## Links

- npm: https://www.npmjs.com/package/@rc-component/virtual-list
- Repository: https://github.com/react-component/virtual-list
- Homepage: https://react-component.github.io/virtual-list
- Issues: https://github.com/react-component/virtual-list/issues
- npm.io page: https://npm.io/package/@rc-component/virtual-list

## Dependencies (4)

- [clsx](https://npm.io/package/clsx.md) ^2.1.1
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^8.0.0
- [@rc-component/util](https://npm.io/package/@rc-component/util.md) ^1.4.0
- [@rc-component/resize-observer](https://npm.io/package/@rc-component/resize-observer.md) ^1.0.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.5.2 (latest) — 2026-09-17
- 1.5.1 — 2026-07-31
- 1.5.0 — 2026-07-31
- 1.4.0 — 2026-07-15
- 1.3.2 — 2026-07-09
- 1.3.1 — 2026-07-09
- 1.3.0 — 2026-07-09
- 1.2.0 — 2026-05-20
- 1.1.0 — 2026-05-18
- 1.0.2 — 2025-12-03
- 1.0.1 — 2025-12-01
- 1.0.0 — 2025-12-01

## README

<div align="center">
  <h1>@rc-component/virtual-list</h1>
  <p><sub><a href="https://ant.design"><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="vertical-align: -0.125em;" /></a> Part of the Ant Design ecosystem.</sub></p>
  <p>📜 Virtual scrolling list component for React.</p>

  <p>
    <a href="https://npmjs.org/package/@rc-component/virtual-list"><img alt="NPM version" src="https://img.shields.io/npm/v/@rc-component/virtual-list.svg?style=flat-square"></a>
    <a href="https://npmjs.org/package/@rc-component/virtual-list"><img alt="npm downloads" src="https://img.shields.io/npm/dm/@rc-component/virtual-list.svg?style=flat-square"></a>
    <a href="https://github.com/react-component/virtual-list/actions/workflows/react-component-ci.yml"><img alt="build status" src="https://github.com/react-component/virtual-list/actions/workflows/react-component-ci.yml/badge.svg"></a>
    <a href="https://app.codecov.io/gh/react-component/virtual-list"><img alt="Codecov" src="https://img.shields.io/codecov/c/github/react-component/virtual-list/master.svg?style=flat-square"></a>
    <a href="https://bundlephobia.com/package/@rc-component/virtual-list"><img alt="bundle size" src="https://img.shields.io/bundlephobia/minzip/@rc-component/virtual-list?style=flat-square"></a>
    <a href="https://github.com/umijs/dumi"><img alt="dumi" src="https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square"></a>
  </p>
</div>

<p align="center">English | <a href="./README.zh-CN.md">简体中文</a></p>

## Highlights

- Built for React and maintained by the rc-component team.
- Used by Ant Design and other React component libraries.
- Ships TypeScript declarations with both ES module and CommonJS outputs.
- Keeps examples, tests, and preview builds aligned with the package source.

## Install

```bash
npm install @rc-component/virtual-list
```

## Usage

```tsx
import List from '@rc-component/virtual-list';

const data = Array.from({ length: 1000 }).map((_, index) => ({
  id: index,
  label: `Item ${index}`,
}));

export default () => (
  <List data={data} height={240} itemHeight={32} itemKey="id">
    {(item) => <div>{item.label}</div>}
  </List>
);
```

## Examples

Run the local dumi site:

```bash
npm install
npm start
```

Then open `http://localhost:8000`.

## API

### List

| Prop       | Description                                                                                                            | Type                                   | Default |
| ---------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ------- |
| children   | Render function for each item. The third argument contains measuring props used by legacy browser compatibility paths. | `(item, index, props) => ReactElement` | -       |
| component  | Custom list container element.                                                                                         | `string` \| `ComponentType`            | `div`   |
| data       | Items rendered by the virtual list.                                                                                    | `T[]`                                  | -       |
| fullHeight | Whether the holder should keep full height.                                                                            | `boolean`                              | `true`  |
| height     | Visible list height.                                                                                                   | `number`                               | -       |
| itemHeight | Minimum item height used to calculate the virtual range.                                                               | `number`                               | -       |
| itemKey    | Key field or key getter for items.                                                                                     | `string` \| `(item) => React.Key`      | -       |
| onScroll   | Called when the list scrolls.                                                                                          | `React.UIEventHandler<HTMLElement>`    | -       |
| styles     | Custom scrollbar part styles.                                                                                          | `object`                               | -       |
| virtual    | Enable virtual rendering.                                                                                              | `boolean`                              | `true`  |

## Development

```bash
npm install
npm start
npm test
npm run build
```

The dumi site runs at `http://localhost:8000` by default.

## Release

```bash
npm run prepublishOnly
```

The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build.

## License

@rc-component/virtual-list is released under the [MIT](./LICENSE) license.

---
_Source: https://npm.io/package/@rc-component/virtual-list · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
