Skip to content
Alea0.1

Data display

VirtualList

A list that only renders what is on screen, for thousands of rows.

Ant Design: List virtual

import { VirtualList } from '@alea/ui';

Examples

Ten thousand rows

Only the visible rows are in the page; scrolling and typeahead still work.

Props

VirtualList props

A list that only renders what is on screen, for thousands of rows (MUI/Mantine virtualized lists).

PropTypeDefaultDescription
aria-labelrequiredstring-Name for screen readers when there is no visible label.
childrenrequired(item: T) => ReactNode-Renders the text of an item.
itemsrequiredT[]-The items; each needs an id.
textValuerequired(item: T) => string-Text for typeahead and screen readers.
heightnumber360Visible height in px. Default 360.
onAction((key: Key) => void)-Called with the id when an item is opened (Enter or click).
rowHeightnumber44Row height in px. Default 44.
selectionMode"single" | "multiple" | "none"'none'none (default), single or multiple.

Accessibility

  • A listbox that keeps the full count (aria-setsize) even when rows are not in the page.

Keyboard

KeyDoes
Arrow Up / DownMove between items
Home / EndFirst or last item
TypingJumps to a matching item

Do and don't

Do

  • Use it from a few hundred items on.
  • Keep rows the same height (rowHeight).

Don't

  • Don't use it for short lists: a normal ListView is simpler.
  • Don't put expanding content in rows.
Tested with axe, keyboard and screen reader roles