Skip to content

CardWindowProps

CardWindowProps<T> = object

The props of CardWindow. T is the type of data.

T extends any[] = any[]

cardRect: Rect

cardRect is used to calculate the rendering of CardWindow.children component. A card or loading card wider than cardRect.width is clipped at the sides of the scroll container.


children: React.ComponentType<CardProps<T>>

children is a component that receives CardProps<T>.


optional container?: object

optional className?: string

container.className are passed to the scrollable large container element.

optional style?: Omit<CSSProperties, "width" | "height" | "overflow" | "overflowX">

container.style are passed to the scrollable large container element. CardWindow sets overflowX to clip, so a card wider than its column never makes the root scroll sideways.


data: T

data is an array. CardWindow passes data to CardWindow.children component.


optional justifyContent?: JustifyContent

The value goes straight to CSS Grid justify-content. The default is space-evenly. start and end follow the writing direction, while left and right do not. stretch grows the columns to fill the row.


optional loading?: Loading

loading? is a property for the infinite loading feature.


optional onScroll?: (props) => void

Called when the CardWindow scroll positions changes.

OnScrollProps

void


optional overScanPx?: number

The number of px to render outside of the visible area. By default, CardWindow overscans 200px.


optional root?: object

optional className?: string

root.className are passed to the root element of CardWindow.

optional style?: Omit<CSSProperties, "overflow">

root.style are passed to the root element of CardWindow.


optional spacing?: Partial<Spacing>

These values are px. The defaults are 8px.


optional thresholdOfVisible?: number

thresholdOfVisible is used for card visibility in onScroll event. Please set a value between 0 and 1. The default is 0.5.

optional getKey(index, data): string

If you can use an id instead of array index for key, define a getKey function.

number

T

string