useTableRowsVirtualization@astryxdesign/core v0.7.12 · useTableRowsVirtualization

Usage

Returns an opaque capability for fixed-height flat-row Table windowing. Pass the capability to Table.virtualization and keep the complete data, columns, explicit stable idKey and plugins on Table. Sizes are positive finite CSS pixels. Supported rows use single-line content; explicit wrapping, arbitrary custom renderers, non-flat rows or invalid identity use ordinary full rendering. Windowing uses the Table-owned scroll wrapper; a caller-provided scrollWrapper takes diagnostic full-render fallback. Mounted rows retain native table semantics and full-table positions; unmounted rows are not promised screen-reader discovery.

ts
import {useTableRowsVirtualization} from '@astryxdesign/core/Table'

Parameters

ParamTypeDescription
rowHeightrequired
number

Total body-row pitch in CSS pixels, including existing density padding and collapsed borders. Must fit text and supported controls without reducing their size.

viewportHeightrequired
number

Bounded Table-owned viewport height in CSS pixels. Table accounts for its headers and chrome.

Examples

Common configurations, variations, and states.
useTableRowsVirtualization - Fixed Height Rows
Open in Playground

A Table with 1,000 product rows in a fixed-height viewport. Scroll vertically to mount the visible rows. The caller keeps all data and columns; this hook does not virtualize columns.

Use with shadcn

Already using the shadcn registry workflow? Install the real Astryx package and a local public re-export. Component implementation source stays in Astryx.

This install URL expires with the draft preview.
bash
npx shadcn@4.19.0 add https://astryx-661m7av2s-fbopensource.vercel.app/shadcn/hooks/use-table-rows-virtualization.json