Interface VirtualizerProps

Props of the useVirtualizer hook.

interface VirtualizerProps {
    containerRef?: RefObject<Element>;
    endIndex: number;
    estimateItemSize?: number | ((index: number) => number);
    isRTL?: boolean;
    onScroll: ((info: Readonly<VirtualizerScrollInfo>) => void);
    orientation?: "vertical" | "horizontal";
    overscanSize?: number;
    paddingStart?: number;
    startIndex: number;
}

Properties

containerRef?: RefObject<Element>

A reference to a scrollable container element. If omitted then the window is a container.

endIndex: number

An index of the last item, exclusive.

estimateItemSize?: number | ((index: number) => number)

An estimated average item size in pixels along the scroll axis, or a callback that returns an estimated size by an item index.

100
isRTL?: boolean

If true then the horizontal scroll events are interpreted as in an RTL environment.

By default, RTL is derived from a container.

onScroll: ((info: Readonly<VirtualizerScrollInfo>) => void)

A handler that is called when a container is being scrolled.

Type declaration

    • (info): void
    • Parameters

      Returns void

orientation?: "vertical" | "horizontal"

The orientation of the scroll axis.

"vertical"
overscanSize?: number

The minimum number of pixels that should be rendered offscreen before and after a visible range. Additional items are rendered to fulfill this size.

0
paddingStart?: number

A padding to apply to the start of a container in pixels.

0
startIndex: number

An index of the first item, inclusive.