I'm using the following Material UI Carousel library and I'm having trouble understanding how can I create multiple items for the carousel.
I have searched in the docs, no solution there, tried to manipulate with CSS by defining width like this:
.item{
margin: 0 auto;
text-align: center;
width: 30%;
}
Didn't worked either.
Here is my code:
function Home() {
var items = [
{
name: "Pizza Begin",
link: "pizza-begin.co.il",
image: Begin
},
{
name: "Mia Luz",
link: "mia-luz.com",
image: Mia
},
{
name: "Nuda Swim",
link: "nudaswim.com"
}
];
return(<>
<Carousel navButtonsAlwaysInvisible={true} animation="slide" activeIndicatorIconButtonProps={{className: "activeIndicator"}}>
{
items.map( (item, i) => <Item key={i} item={item} /> )
}
</Carousel>
</>);
}
function Item(props)
{
return (
<Paper className="item">
<img className="imageCarousel" src={props.item.image} alt={props.item.name} />
<h2 onClick={() => { window.location.href = props.item.link; }}>{props.item.name}</h2>
</Paper>
)
}
export default Home;
Right now each slide contains one Item, my goal is to reach 3 items on each slide.
How can I use multiple items in one slide using Material UI Carousel?