To use the carousel, wrap your slide items (any JSX elements) inside the <Carousel> component. Each child of the <Carousel> represents a single slide.
import React from 'react';
import Carousel from 'react-material-ui-carousel';
import { Paper, Button } from '@mui/material';
function Example() {
const items = [
{ name: "Item 1", description: "Description 1" },
{ name: "Item 2", description: "Description 2" }
];
return (
<Carousel>
{items.map((item, i) => (
<Paper key={i}>
<h2>{item.name}</h2>
<p>{item.description}</p>
<Button>Check it out!</Button>
</Paper>
))}
</Carousel>
);
}