Data Display
Virtual List
Windowed list — the server renders only the first slice; initVirtualList re-slices it on scroll.
- Element
<div>- Module
@basenative/components- Function
renderVirtualList
Quick start
Import the render function and call it from your server template.
import { renderVirtualList } from '@basenative/components';
renderVirtualList({ items, itemHeight: 40, containerHeight: 240 });
Examples
Each block is a real server render — no mockups, no virtual DOM.
Windowed 1,000 rows
Only the visible slice is in the DOM. Scroll to see new rows materialize.
renderVirtualList({ items, itemHeight: 40, containerHeight: 240 })
Options
Arguments accepted by renderVirtualList().
| Option | Type | Default | Description |
|---|---|---|---|
items |
string[] |
— |
Items to render. |
itemHeight |
number |
40 |
Row height in px. |
containerHeight |
number |
320 |
Viewport height in px. |