Props accepted by VirtualGrid

interface VirtualGridProps {
    children: VirtualGridItem;
    className?: string;
    columnCount: number;
    columnOffsetMapping: ItemOffsetMapping;
    height: number;
    innerClassName?: string;
    innerRender?: VirtualInnerRender;
    itemData?: unknown;
    itemKey?: ((rowIndex: number, columnIndex: number, data: unknown) => Key);
    maxCssSize?: number;
    minNumPages?: number;
    onScroll?: ((rowOffset: number, columnOffset: number, newRowScrollState: ScrollState, newColumnScrollState: ScrollState) => void);
    outerRender?: VirtualOuterRender;
    rowCount: number;
    rowOffsetMapping: ItemOffsetMapping;
    useIsScrolling?: boolean;
    width: number;
}

Hierarchy (view full)

Properties

children: VirtualGridItem

Component used as a template to render items in the grid. Must implement VirtualGridItem interface.

className?: string

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

columnCount: number

Number of columns in the grid

columnOffsetMapping: ItemOffsetMapping

Implementation of ItemOffsetMapping interface that defines size and offset to each column in the grid

Use useFixedSizeItemOffsetMapping or useVariableSizeItemOffsetMapping to create implementations for common cases.

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.

innerRender?: VirtualInnerRender

Render prop implementing VirtualInnerRender. Used to customize VirtualGrid.

itemData?: unknown

Passed as VirtualBaseItemProps.data to each child item

itemKey?: ((rowIndex: number, columnIndex: number, data: unknown) => Key)

Function that defines the key to use for each item given row and column index and value of VirtualBaseProps.itemData.

(rowIndex, columnIndex, _data) => `${rowIndex}:${columnIndex}`
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 VirtualBaseProps.maxCssSize big. You should never normally need to change this.

100
onScroll?: ((rowOffset: number, columnOffset: number, newRowScrollState: ScrollState, newColumnScrollState: ScrollState) => void)

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

Type declaration

    • (rowOffset, columnOffset, newRowScrollState, newColumnScrollState): void
    • Parameters

      • rowOffset: number

        Resulting overall row offset. Can be passed to ItemOffsetMapping to determine first row.

      • columnOffset: number

        Resulting overall column offset. Can be passed to ItemOffsetMapping to determine first column.

      • newRowScrollState: ScrollState

        New ScrollState for rows that will be used for rendering.

      • newColumnScrollState: ScrollState

        New ScrollState for columns that will be used for rendering.

      Returns void

outerRender?: VirtualOuterRender

Render prop implementing VirtualOuterRender. Used to customize VirtualGrid.

rowCount: number

Number of rows in the grid

rowOffsetMapping: ItemOffsetMapping

Implementation of ItemOffsetMapping interface that defines size and offset to each row in the grid

Use useFixedSizeItemOffsetMapping or useVariableSizeItemOffsetMapping to create implementations for common cases.

useIsScrolling?: boolean

Determines whether the component should track whether it's being actively scrolled and pass to child items as VirtualBaseItemProps.isScrolling.

false
width: number

Component width