Props accepted by VirtualGrid

interface VirtualGridProps {
    children: DisplayGridItem;
    className?: string;
    columnCount: number;
    columnOffsetMapping: ItemOffsetMapping;
    height: number;
    innerClassName?: string;
    innerRender?: VirtualContainerRender;
    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?: VirtualContainerRender;
    rowCount: number;
    rowOffsetMapping: ItemOffsetMapping;
    useIsScrolling?: boolean;
    width: number;
}

Hierarchy (view full)

Properties

children: DisplayGridItem

Component used as a template to render items in the grid. Must implement DisplayGridItem 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.

Render prop implementing VirtualContainerRender. Used to customize DisplayGrid within VirtualGrid inner container.

itemData?: unknown

Passed as DisplayBaseItemProps.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 VirtualScrollableProps.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

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

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 through when rendering its content.

false
width: number

Component width