Skip to content

show multiple items #229

Open
Open

Description

@SamehArmouche

Can I show multiple item in Carousel?
Actual behaviour
image
Expected behaviour
image

Activity

  1. konrad-armatys commented on Jan 19, 2024

    @konrad-armatys

    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.

  2. BryanLopez35 commented on May 7, 2024

    @BryanLopez35

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions