React Virtual
@tanstack/react-virtual
Headless UI for virtualizing scrollable elements in React
Tables
react
vue
solid
virtual
virtual-core
datagrid
@tanstack/react-virtual
Tables
javascript
npm
Stars
7.1k
Weekly
21M
Open issues
114
Bundle
~15 kB
Installation
npm install @tanstack/react-virtualCode example
import { useVirtual } from "@tanstack/react-virtual";
const rows = [
{ id: 1, name: "Ada", role: "Engineer" },
{ id: 2, name: "Linus", role: "Maintainer" },
];
export function Example() {
const table = useVirtual({ data: rows, columns: [{ accessorKey: "name" }, { accessorKey: "role" }] });
return <pre>{JSON.stringify(table, null, 2)}</pre>;
}Pros & cons
Pros
- Actively maintained by Tanner Linsley
- 21M weekly downloads. Battle tested
- First-class TypeScript definitions
- MIT licensed
Considerations
- Adds roughly ~15 kB to your bundle
- Needs client-only rendering in SSR frameworks
- Not supported in React Native
- 114 open issues on GitHub