useVirtual API
API reference for the useVirtual composable.
string | numberThe height of the item.
string | numberThe height of the container.
numberThe number of extra items to render.
VirtualDirectionThe direction of the scrolling.
VirtualAnchorThe anchor of the scrolling.
booleanWhether to smooth the anchor position.
(distance: number) => void | Promise<void>The callback to call when the start is reached.
(distance: number) => void | Promise<void>The callback to call when the end is reached.
numberThe threshold for the start.
numberThe threshold for the end.
booleanWhether to enable momentum scrolling.
booleanWhether to enable elastic scrolling.
Ref<HTMLElement, HTMLElement>The element that is being virtualized.
ComputedRef<VirtualItem<T>[]>The items that are being virtualized.
Readonly<ShallowRef<number>>The offset of the virtualized items.
Readonly<ShallowRef<number>>The size of the virtualized items.
ShallowRef<VirtualState>The state of the virtualized items.
(index: number, options?: ScrollToOptions) => voidScroll to an item by index.
() => voidThe scroll event handler.
() => voidThe scrollend event handler.
(index: number, height: number) => voidResize an item by index.
() => voidReset the virtualized items.