SortableGridListAn sortable grid list (based on GridList component)
- UX Guidelines
- Dev
PlaygroundCode Example
function Example(props) { const [shouldOrderByIndex, setShouldOrderByIndex] = useState(false); const data = Data.products.map((product) => ({ ...product })); renderItem = ({ item }) => { return ( <Card flex customValue={item.id}> <Card.Section imageSource={{ uri: item.mediaUrl }} imageStyle={{ width: '100%', height: 108.7, borderRadius: BorderRadiuses.br10 }} imageProps={{ customOverlayContent: ( <Text margin-s1 h1 orange30> {item.id} </Text> ), }} /> </Card> ); }; return ( <View flex> <Playground.ToggleControl title={'Order by index'} state={shouldOrderByIndex} setState={setShouldOrderByIndex} /> <SortableGridList data={data} flexMigration // onOrderChange={onOrderChange} maxItemWidth={140} renderItem={renderItem} itemSpacing={Spacings.s3} listPadding={Spacings.s5} orderByIndex={shouldOrderByIndex} /> </View> ); }

TIP
This component extends the lists/GridList props.
APIThis is the list of additional props for the component