Created
October 16, 2018 09:49
-
-
Save manniru/4ea56c18f36c4004d6fda1a725f10de8 to your computer and use it in GitHub Desktop.
React Material-UI Carousel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import Paper from '@material-ui/core/Paper'; | |
import Typography from '@material-ui/core/Typography'; | |
import { Carousel } from "react-responsive-carousel"; | |
import "react-responsive-carousel/lib/styles/carousel.min.css"; | |
class App extends React.Component { | |
render() { | |
return ( | |
<div> | |
<Paper style={{margin: 10}} elevation={3}> | |
<Carousel | |
autoPlay | |
showArrows={true} | |
showStatus={true} | |
width={960} | |
stopOnHover={false} | |
interval={1000} | |
> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-1.jpg" /> | |
<p className="legend">Legend 1</p> | |
</div> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-2.jpg" /> | |
<p className="legend">Legend 2</p> | |
</div> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-3.jpg" /> | |
<p className="legend">Legend 3</p> | |
</div> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-4.jpg" /> | |
<p className="legend">Legend 4</p> | |
</div> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-5.jpg" /> | |
<p className="legend">Legend 5</p> | |
</div> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-6.jpg" /> | |
<p className="legend">Legend 6</p> | |
</div> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-7.jpg" /> | |
<p className="legend">Legend 7</p> | |
</div> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-8.jpg" /> | |
<p className="legend">Legend 8</p> | |
</div> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-9.jpg" /> | |
<p className="legend">Legend 9</p> | |
</div> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-10.jpg" /> | |
<p className="legend">Legend 10</p> | |
</div> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-11.jpg" /> | |
<p className="legend">Legend 11</p> | |
</div> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-12.jpg" /> | |
<p className="legend">Legend 12</p> | |
</div> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-13.jpg" /> | |
<p className="legend">Legend 13</p> | |
</div> | |
<div> | |
<img src="http://lorempixel.com/output/cats-q-c-640-480-14.jpg" /> | |
<p className="legend">Legend 14</p> | |
</div> | |
</Carousel> | |
</Paper> | |
</div> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment