Virtualizer API
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| Virtualizer | Data |
| createVirtual | Data |
| Data Table | Data |
Virtualizer.Root
Props
itemHeight
number | `${number}` | null | undefinedThe height of each item, in pixels (a number or numeric string). Used as the initial estimate for unmeasured items
height
string | number | undefinedHeight of the scroll container; numbers and unitless numeric strings are pixels, other strings pass through as CSS
overscan
number | undefinedExtra items rendered outside the viewport for smoother scrolling (default: 5)
Default: 5
anchorSmooth
boolean | undefinedWhether anchor restoration scrolls smoothly (default: true)
Default: true
topThreshold
number | undefinedPixels from the top edge within which top fires (default: 0)
Default: 0
bottomThreshold
number | undefinedPixels from the bottom edge within which bottom fires (default: 0)
Default: 0
Events
Slots
default
VirtualizerRootSlotProps<T>Virtualizer.Item
Props
namespace
string | undefinedNamespace for context injection from parent Virtualizer.Root
Default: "v0:virtualizer:root"
Slots
default
anyVirtualizer.Spacer
Props
edge
"start" | "end" | undefinedWhich off-screen range this spacer reserves. start is the rows above the window; end is the rows below it
Default: "start"
namespace
string | undefinedNamespace for context injection from parent Virtualizer.Root
Default: "v0:virtualizer:root"
Slots
default
VirtualizerSpacerSlotProps