CardWindowProps
CardWindowProps<
T> =object
The props of CardWindow. T is the type of data.
Type Parameters
Section titled “Type Parameters”T extends any[] = any[]
Properties
Section titled “Properties”cardRect
Section titled “cardRect”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
Section titled “children”children:
React.ComponentType<CardProps<T>>
children is a component that receives CardProps<T>.
container?
Section titled “container?”
optionalcontainer?:object
className?
Section titled “className?”
optionalclassName?:string
container.className are passed to the scrollable large container element.
style?
Section titled “style?”
optionalstyle?: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.
justifyContent?
Section titled “justifyContent?”
optionaljustifyContent?: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.
loading?
Section titled “loading?”
optionalloading?:Loading
loading? is a property for the infinite loading feature.
onScroll?
Section titled “onScroll?”
optionalonScroll?: (props) =>void
Called when the CardWindow scroll positions changes.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
overScanPx?
Section titled “overScanPx?”
optionaloverScanPx?:number
The number of px to render outside of the visible area. By default, CardWindow overscans 200px.
optionalroot?:object
className?
Section titled “className?”
optionalclassName?:string
root.className are passed to the root element of CardWindow.
style?
Section titled “style?”
optionalstyle?:Omit<CSSProperties,"overflow">
root.style are passed to the root element of CardWindow.
spacing?
Section titled “spacing?”
optionalspacing?:Partial<Spacing>
These values are px. The defaults are 8px.
thresholdOfVisible?
Section titled “thresholdOfVisible?”
optionalthresholdOfVisible?:number
thresholdOfVisible is used for card visibility in onScroll event.
Please set a value between 0 and 1. The default is 0.5.
Methods
Section titled “Methods”getKey()?
Section titled “getKey()?”
optionalgetKey(index,data):string
If you can use an id instead of array index for key,
define a getKey function.
Parameters
Section titled “Parameters”number
T
Returns
Section titled “Returns”string