Overview
Virtualization lives in the separate mates-virtual package (not the core mates bundle). Import virtualList, virtualMasonry, virtualTable, or masonryGrid from mates-virtual.
virtualList renders only visible rows with automatic height measurement — no itemHeight required. The parent of the expression is the scroll host unless you pass { scroller: true }.
virtualMasonry places items into columns using a required getAspectRatio so heights can be derived without measuring every cell. masonryGrid is a non-virtual CSS column-count layout for smaller feeds.
Which API?
|
API
|
Virtualized?
|
Notes
|
|---|---|---|
virtualList
| Yes — flow | Vertical (default) or horizontal list. Optional keyFn. Auto-measures item size. |
virtualMasonry
| Yes — masonry | Requires getAspectRatio. Optional keyFn, itemSize, gap, scroller, pin. |
virtualTable
| Yes — rows |
Rows must have id. Headless role=table structure + VTABLE_CLASSES.
|
masonryGrid
| No | CSS columns; all items in the DOM. Prefer virtualMasonry for large lists. |
virtualList — thousands of rows
virtualList(items, keyFn, template) keeps only visible rows in the DOM. Heights are measured automatically via ResizeObserver — no itemHeight option.
virtualMasonry — aspect-ratio columns
virtualMasonry(items, keyFn, template, options) requires getAspectRatio so column heights can be derived. Use a constant ratio (e.g. () => 1) for a uniform card grid.