Open SamehArmouche opened 8 months ago
I have achieved this by making a Carousel of Grid containers. Here is the code for 3 items on one slide:
<Carousel>
{groupedItems.map(itemsArray => (
<Grid container spacing={2} key={itemsArray.id}>
{itemsArray.map(item => (
<Grid item xs={4} key={item.idx}>
<ItemComponent key={item.id} />
</Grid>
))}
</Grid>
))}
</Carousel>
Note that to use it properly groupedItems should contain arrays with 3 elements each and preferably an id.
I have achieved this by making a Carousel of Grid containers. Here is the code for 3 items on one slide:
<Carousel> {groupedItems.map(itemsArray => ( <Grid container spacing={2} key={itemsArray.id}> {itemsArray.map(item => ( <Grid item xs={4} key={item.idx}> <ItemComponent key={item.id} /> </Grid> ))} </Grid> ))} </Carousel>
Note that to use it properly groupedItems should contain arrays with 3 elements each and preferably an id.
This works for me, thanks a lot!
Can I show multiple item in Carousel? Actual behaviour Expected behaviour