VirtualList
Renders only the visible rows of a long list. Rows need a fixed itemHeight.
Banana 1
Banana 2
Banana 3
Banana 4
Banana 5
Banana 6
Banana 7
Banana 8
Banana 9
Banana 10
Props
itemsany[]All items.
itemHeightnumberFixed row height in px.
heightnumberDefault:320Viewport height in px.
overscannumberDefault:4Extra rows rendered above and below.
renderItem(item, index) => ReactNodeRenders a row’s content.
getKey(item, index) => keyDefault:indexRow key.
labelstringDefault:'List'Accessible name.
classNamestringDefault:''Extra classes for the root element.
| Prop | Type | Default | Description |
|---|---|---|---|
items | any[] | – | All items. |
itemHeight | number | – | Fixed row height in px. |
height | number | 320 | Viewport height in px. |
overscan | number | 4 | Extra rows rendered above and below. |
renderItem | (item, index) => ReactNode | – | Renders a row’s content. |
getKey | (item, index) => key | index | Row key. |
label | string | 'List' | Accessible name. |
className | string | '' | Extra classes for the root element. |