GridView
An auto-generated grid view that calculate item size according to given props
(code example)
Usageβ
Live Editor
<GridView items={[{title: 'item 1', onPress: () => console.log('item 1 pressed')}, {title: 'item 2', onPress: () => console.log('item 2 pressed')}]} numColumns={2} lastItemLabel={'+'} lastItemOverlayColor={'Colors.rgba(Colors.blue30)'} />
Result
Loading...
APIβ
itemSpacingβ
Spacing between each item
number
itemsβ
The list of items based on GridListItem props
GridListItemProps[]
keepItemSizeβ
whether to keep the items initial size when orientation changes, in which case the apt number of columns will be calculated automatically.
boolean
lastItemLabelβ
overlay label for the last item
string | number
lastItemOverlayColorβ
color of overlay label for the last item
string
numColumnsβ
Number of items to show in a row
number
renderCustomItemβ
Pass to render a custom item
(item: GridListItemProps) => React.ReactElement
viewWidthβ
pass the desired grid view width (will improve loading time)
number