Props accepted by DisplayList

interface DisplayListProps {
    children: DisplayListItem;
    className?: string;
    height: number;
    innerClassName?: string;
    innerRender?: VirtualContainerRender;
    isScrolling?: boolean;
    itemCount: number;
    itemData?: unknown;
    itemKey?: ((index: number, data: unknown) => Key);
    itemOffsetMapping: ItemOffsetMapping;
    layout?: ScrollLayout;
    offset: number;
    outerRender?: VirtualContainerRender;
    width: number;
}

Hierarchy (view full)

Properties

children: DisplayListItem

Component used as a template to render items in the list. Must implement DisplayListItem interface.

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.

Renders the inner grid div containing all the list items

Render prop implementing VirtualContainerRender. Used to customize display component inner container.

isScrolling?: boolean

Passed as DisplayBaseItemProps.isScrolling to each child item

Provided as a convenience when combining display components with VirtualScroll Not interpreted by the display component itself

itemCount: number

Number of items in the list

itemData?: unknown

Passed as DisplayBaseItemProps.data to each child item

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

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

(index, _data) => index

itemOffsetMapping: ItemOffsetMapping

Implementation of ItemOffsetMapping interface that defines size and offset to each item in the list

Use useFixedSizeItemOffsetMapping or useVariableSizeItemOffsetMapping to create implementations for common cases.

layout?: ScrollLayout

Choice of 'vertical' or 'horizontal' layouts

'vertical'
offset: number

Offset to start of displayed content

Renders the outer viewport div which provides a window onto the inner grid div

Render prop implementing VirtualContainerRender. Used to customize display component outer container.

width: number

Component width