React carousel component
npm
npm install react-slick --saveyarn
yarn add react-slickAlso install slick-carousel for css and font
npm install slick-carousel
// Import css files
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";or add cdn link in your html
<link
rel="stylesheet"
type="text/css"
charset="UTF-8"
href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css"
/>
<link
rel="stylesheet"
type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css"
/>import React from "react";
import Slider from "react-slick";
export default function SimpleSlider() {
var settings = {
dots: true,
infinite: true,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1
};
return (
<Slider {...settings}>
</Slider>
);
}For all available props, go here.
For all available methods, go here
Want to run demos locally
git clone https://github.com/akiran/react-slick
cd react-slick
npm install
npm start
open http://localhost:8080Join our discord channel to discuss react-slick bugs and ask for help
Please see the contributing guidelines
React error #130 when bundled by Vite 8 / rolldown: default import is the CJS namespace, not the Slider class
problem with responsive when mounting the component
Bug: Wrong calculation of the initial state when the responsive options are provided.
Responsive breakpoints not applied on initial render in react-slick v0.31.0
Element type is invalid: expected a string (for built-in components) or a class/function...
Unexpected Behavior in Vertical Mode Swipe
Why is the progressive lazy load timer set to 1 second
Feature Request: Add offset prop for autoplay initial delay
react-slick is not working correctly in RTL language
Enforce ARIA rule