createVirtual API
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| createVirtual | Data |
| createFilter | Data |
| createOverflow | Semantic |
Functions
createVirtual
(items: Ref<readonly T[], readonly T[]>, _options?: VirtualOptions<T>) => VirtualContext<T>createVirtualContext
(items: Ref<readonly T[], readonly T[]>, _options?: VirtualContextOptions<T>) => ContextTrinity<VirtualContext<T>>Creates a virtual scrolling context with dependency injection support.
useVirtual
(namespace?: string) => VirtualContext<T>Returns the current virtual context from dependency injection.
Options
onStartReached
((distance: number) => void | Promise<void>) | undefinedThe callback to call when the start is reached.
onEndReached
((distance: number) => void | Promise<void>) | undefinedThe callback to call when the end is reached.
marker
MaybeRefOrGetter<HTMLElement | null | undefined>Element at the top of the list inside the scroll parent.
Its offsetTop is removed from the scroll position, so a header or
padding above the list does not shift the window. Omit it when the
list starts at the top of the scroller.
itemKey
((item: T, index: number) => string | number) | undefinedIdentity of an item. Measured heights follow this key when items are prepended, filtered, or reordered. Omit it to keep each height on its index. Duplicate keys keep the latest measurement.
ownElement
boolean | undefinedWrite momentum and overscroll styles onto the scroll element.
Set this to false when a parent owns that element.
Default: true