List
Render caller-defined rows with optional virtual scrolling.
Use List when the caller owns each row’s markup and needs a stable collection surface. Pass items and an itemRender component; List does not take row content through children. Add a virtual renderer for large collections only when ordinary rendering becomes costly.
Basic usage#
Playground#
- Alpha
- Beta
Anatomy#
Usage#
Row ownership and virtualization#
itemRender receives the item, its index, and row props. Apply those props to the final row element when using virtualRender; the virtualizer needs them for positioning and measurement. The default root is a <ul> with role="list", so render list-item semantics in each row or choose a different root with as for another structure. TypeScript infers the item and root element types from items and as.
createListVirtualizer is an optional adapter from moraine/virtualizer and needs @tanstack/virtual-core. The visible row count and scroll behavior depend on your estimated or measured row sizes.
Read the Virtualization guide for setup, row measurements, stable keys, and keyboard navigation.
Examples#
Dynamic heights#
Props#
Renders a <ul> element by default.