Back to Components

Data

VirtualList

Windowed list for huge datasets — renders only the visible slice. Fixed item height; for variable-height virtualisation, fork and adapt.

Examples

10,000 rows, 36px each

Row 1 id-00000
Row 2 id-00001
Row 3 id-00002
<VirtualList items={items} itemHeight={36} height="240px">
  {#snippet item(it)}
    <div>{it.label}</div>
  {/snippet}
</VirtualList>

Props

PropTypeDefaultDescription
itemsT[]Full dataset; only the visible window is rendered.
itemHeightnumberFixed row height in px.
heightstring'320px'Viewport height.
overscannumber3Extra rows above/below viewport.
itemSnippet<[T, index]>Per-row renderer.

Install

CLI

npx @a3tai/mittsu add virtual-list