Interface: WindowVirtualizerProps\
June 29, 2026 ยท View on GitHub
Interface: WindowVirtualizerProps<T>
Defined in: src/react/WindowVirtualizer.tsx:76
Props of WindowVirtualizer.
Type Parameters
T
T = unknown
Properties
children
children:
ReactNode| ((data,index) =>ReactElement)
Defined in: src/react/WindowVirtualizer.tsx:82
Elements rendered by this component.
You can also pass a function and set WindowVirtualizerProps.data to create elements lazily.
data?
optionaldata?:ArrayLike<T>
Defined in: src/react/WindowVirtualizer.tsx:86
The data items rendered by this component. If you set a function to WindowVirtualizerProps.children, you have to set this prop.
bufferSize?
optionalbufferSize?:number
Defined in: src/react/WindowVirtualizer.tsx:91
Extra item space in pixels to render before/after the viewport. The minimum value is 0. Lower value will give better performance but you can increase to avoid showing blank items in fast scrolling.
Default Value
200
itemSize?
optionalitemSize?:number
Defined in: src/react/WindowVirtualizer.tsx:98
Item size hint for unmeasured items in pixels. It will help to reduce scroll jump when items are measured if used properly.
- If not set, initial item sizes will be automatically estimated from measured sizes. This is recommended for most cases.
- If set, you can opt out estimation and use the value as initial item size.
shift?
optionalshift?:boolean
Defined in: src/react/WindowVirtualizer.tsx:102
While true is set, scroll position will be maintained from the end not usual start when items are added to/removed from start. It's recommended to set false if you add to/remove from mid/end of the list because it can cause unexpected behavior. This prop is useful for reverse infinite scrolling.
horizontal?
optionalhorizontal?:boolean
Defined in: src/react/WindowVirtualizer.tsx:106
If true, rendered as a horizontally scrollable list. Otherwise rendered as a vertically scrollable list.
cache?
optionalcache?:CacheSnapshot
Defined in: src/react/WindowVirtualizer.tsx:112
You can restore cache by passing a CacheSnapshot on mount. This is useful when you want to restore scroll position after navigation. The snapshot can be obtained from WindowVirtualizerHandle.cache.
The length of items should be the same as when you take the snapshot, otherwise restoration may not work as expected.
ssrCount?
optionalssrCount?:number
Defined in: src/react/WindowVirtualizer.tsx:116
A prop for SSR. If set, the specified amount of items will be mounted in the initial rendering regardless of the container size until hydrated. The minimum value is 0.
as?
optionalas?:CustomContainerComponent| keyof IntrinsicElements
Defined in: src/react/WindowVirtualizer.tsx:121
Component or element type for container element.
Default Value
"div"
item?
optionalitem?:CustomItemComponent| keyof IntrinsicElements
Defined in: src/react/WindowVirtualizer.tsx:126
Component or element type for item element. This component will get CustomItemComponentProps as props.
Default Value
"div"
onScroll?
optionalonScroll?: () =>void
Defined in: src/react/WindowVirtualizer.tsx:130
Callback invoked whenever scroll offset changes.
Returns
void
onScrollEnd?
optionalonScrollEnd?: () =>void
Defined in: src/react/WindowVirtualizer.tsx:134
Callback invoked when scrolling stops.
Returns
void