import React from 'react'; import Carousel from 'react-material-ui-carousel' import { Paper, Button } from '@material-ui/core' function Example(props) { var items = [ { name: "Random Name #1", description: "Probably the most random thing you have ever seen!" }, { name: "Random Name #2", description: "Hello World!" } ] return ( <Carousel> { items.map( (item, i) => <Item key={i} item={item} /> ) } </Carousel> ) } function Item(props) { return ( <Paper> <h2>{props.item.name}</h2> <p>{props.item.description}</p> <Button className="CheckButton"> Check it out! </Button> </Paper> ) }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter