Props accepted by VirtualScroll

interface VirtualScrollProps {
    children: VirtualContentRender;
    className?: string;
    height: number;
    innerClassName?: string;
    innerRender?: VirtualContainerRender;
    maxCssSize?: number;
    minNumPages?: number;
    onScroll?: ((verticalOffset: number, horizontalOffset: number, newVerticalScrollState: ScrollState, newHorizontalScrollState: ScrollState) => void);
    outerRender?: VirtualContainerRender;
    scrollHeight?: number;
    scrollWidth?: number;
    useIsScrolling?: boolean;
    useOffsets?: boolean;
    width: number;
}

Hierarchy (view full)

Properties

Function implementing VirtualContentRender that renders the content that needs to respond to scrolling

className?: string

The className applied to the outer container element. Use when styling the entire component.

height: number

Component height

innerClassName?: string

The className applied to the inner container element. Use for special cases when styling only the inner container and items.

Render prop implementing VirtualContainerRender. Used to customize VirtualScroll inner container.

maxCssSize?: number

Maximum size for CSS element beyond which layout breaks. You should never normally need to change this. The default value is compatible with all major browsers.

6000000
minNumPages?: number

The minimum number of virtual pages to use when inner container would otherwise be more than VirtualScrollableProps.maxCssSize big. You should never normally need to change this.

100
onScroll?: ((verticalOffset: number, horizontalOffset: number, newVerticalScrollState: ScrollState, newHorizontalScrollState: ScrollState) => void)

Callback after a scroll event has been processed and state updated but before rendering

Type declaration

    • (verticalOffset, horizontalOffset, newVerticalScrollState, newHorizontalScrollState): void
    • Parameters

      • verticalOffset: number

        Resulting overall vertical offset.

      • horizontalOffset: number

        Resulting overall horizontal offset.

      • newVerticalScrollState: ScrollState

        New vertical ScrollState that will be used for rendering.

      • newHorizontalScrollState: ScrollState

        New horizontal ScrollState that will be used for rendering.

      Returns void

Render prop implementing VirtualContainerRender. Used to customize VirtualScroll outer container.

scrollHeight?: number

Height of area to scroll over

0
scrollWidth?: number

Width of area to scroll over

0
useIsScrolling?: boolean

Determines whether the component should track whether it's being actively scrolled and pass through when rendering its content.

false
useOffsets?: boolean

Determines whether the component should pass verticalOffset and horizontalOffset to children when rendering.

Can reduce the number of renders needed if these props aren't used

true
width: number

Component width