GridList
An auto-generated grid list that calculate item size according to given props
(code example)
info
This component extends FlatList props.
Usageβ
Live Editor
<GridList> data={items} maxItemWidth={140} numColumns={2} itemSpacing={Spacings.s3} listPadding={Spacings.s5} />
Result
Loading...
APIβ
containerWidthβ
Pass when you want to use a custom container width for calculation
number
contentContainerStyleβ
Custom content container style
ScrollView[contentContainerStyle]
itemSpacingβ
Spacing between each item
number
keepItemSizeβ
whether to keep the items initial size when orientation changes, in which case the apt number of columns will be calculated automatically.
boolean
listPaddingβ
List padding (used for item size calculation)
number
maxItemWidthβ
Allow a responsive item width to the maximum item width
number
numColumnsβ
Number of items to show in a row (ignored when passing maxItemWidth)
number