You will find the styles for this component inassets/scss/plugins/_plugin-react-slick.scss
.
import React from "react";
// react component for creating beautiful carousel
import Carousel from "react-slick";
// @material-ui/core components
import { makeStyles } from "@material-ui/core/styles";
// @material-ui/icons
import LocationOn from "@material-ui/icons/LocationOn";
// core components
import GridContainer from "components/Grid/GridContainer.js";
import GridItem from "components/Grid/GridItem.js";
import Card from "components/Card/Card.js";
import carouselStyle from "styles/jss/nextjs-material-kit-pro/pages/componentsSections/carouselStyle.js";
const useStyles = makeStyles(carouselStyle);
export default function SectionCarousel() {
const classes = useStyles();
const settings = {
dots: true,
infinite: true,
speed: 1000,
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true
};
return (
<div className={classes.section} id="carousel">
<div className={classes.container}>
<GridContainer>
<GridItem xs={12} sm={10} md={8} className={classes.marginAuto}>
<Card>
<Carousel {...settings}>
<div>
<img src="/img/bg.jpg" alt="First slide" className="slick-image" />
<div className="slick-caption">
<h4>
<LocationOn className="slick-icons" />
Yellowstone National Park, United States
</h4>
</div>
</div>
<div>
<img
src="/img/bg2.jpg"
alt="Second slide"
className="slick-image"
/>
<div className="slick-caption">
<h4>
<LocationOn className="slick-icons" />
Somewhere Beyond, United States
</h4>
</div>
</div>
<div>
<img src="/img/bg3.jpg" alt="Third slide" className="slick-image" />
<div className="slick-caption">
<h4>
<LocationOn className="slick-icons" />
Yellowstone National Park, United States
</h4>
</div>
</div>
</Carousel>
</Card>
</GridItem>
</GridContainer>
</div>
</div>
);
}
We've added some extra classes to the default ones from react-slick.
These are .slick-image
for the image of the slide, .slick-caption
, the text that appears over the image and .slick-icons
, used for the icon that goes along with the text.
For more details please refer to react-slick's official docs.