Skip to content
English
Virtual table comes with Pro. Its preview shows once you unlock it.

How it works

One scroll box holds a sticky, slightly frosted header and a body as tall as every row together; only the rows in view plus a few either side are rendered, each placed with translateY on a shared grid template, so scrolling never lays out the rest. Scroll position is read once per animation frame. While scrolling, a dark chip with the visible range rises at the bottom on a spring and sinks away 700ms after the scroll stops. Overscroll is contained so the page does not move when the list reaches an end, and the box is focusable for keyboard scrolling.

Use it for

  • Logs, events, ledgers and exports with thousands of rows that people scroll through.
  • Any table where rendering every row at once would make the page slow.

Look elsewhere when

  • Rows of different heights: this layout needs a fixed row height.
  • When people need the browser's find-in-page over every row: off-screen rows do not exist in the page.

Usage

import { VirtualTable } from './VirtualTable.jsx'

export function RequestLog({ entries }) {
  return (
    <VirtualTable
      label="Request log"
      rows={entries}
      rowHeight={40}
      height={420}
      columns={[
        { key: 'id', title: 'Request', width: 120 },
        { key: 'path', title: 'Endpoint' },
        { key: 'status', title: 'Status', width: 72 },
        { key: 'ms', title: 'Duration', width: 84, align: 'right', render: (r) => `${r.ms} ms` },
      ]}
    />
  )
}

Props

PropTypeDefaultWhat it does
rows | rowCount + getRowobject[] | number + (index) => object—Either the full array, or a count and a function that returns one row, so very large or computed data never becomes one array.
columns{ key, title, width?: number | string, align?: 'left' | 'right', render?: (row, index) => ReactNode, hideBelow?: boolean }[]—Widths are grid tracks (px numbers or any track such as '2fr'); the default is a flexible track. hideBelow drops a column under 460px.
rowHeight / height / overscannumber40 / 360 / 6Fixed row height, viewport height, and rows rendered beyond each edge.
zebrabooleanfalseAlternate row fills.
label / labelsstring / { range(first, last, total) }'Table'Accessible name of the table and the wording of the range chip.

Accessibility

  • The box has role table with aria-rowcount for the full count, and every rendered row carries aria-rowindex, so screen readers report the real position.
  • Header cells are columnheaders and the first cell of each row is a rowheader.
  • The scroll box is focusable; arrow keys, Page Up/Down, Home and End scroll it natively.
  • The range chip is decorative; reduced motion makes it fade without rising.

Motion

Range chip: 200ms fade and a 320ms spring rise while scrolling, gone 700ms after it stops. Row hover: 160ms.

Add it to your project

Pro members copy a prompt and their coding agent installs the source, the same way as the free components.

VirtualTable.jsxvirtual-table.csstokens.cssREADME.md

Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.

Tables
Compare table comes with Pro. Its preview shows once you unlock it.
Data bar table comes with Pro. Its preview shows once you unlock it.