React Slick Carousel

0.31.0 · active · verified Sun Apr 19

react-slick is a popular React component that serves as a port of the original jQuery-based `slick-carousel` library. It provides a highly customizable and responsive carousel solution for React applications, abstracting away the underlying jQuery dependency for seamless integration. The current stable version is 0.31.0, with a cadence of regular patch and minor releases addressing bugs and supporting newer React versions. Key differentiators include its extensive feature set inherited from slick-carousel, broad compatibility with React versions (from 0.14.0 up to 19.0.0), and a strong community backing. It requires separate installation and explicit CSS imports from `slick-carousel` for its essential styling and fonts.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates a basic carousel setup with responsive behavior, dots, infinite looping, autoplay, and six simple slides, configuring common settings and importing necessary styles.

import React from 'react';
import Slider from 'react-slick';
import 'slick-carousel/slick/slick.css';
import 'slick-carousel/slick/slick-theme.css';

export default function SimpleSlider() {
  const settings = {
    dots: true,
    infinite: true,
    speed: 500,
    slidesToShow: 1,
    slidesToScroll: 1,
    autoplay: true,
    autoplaySpeed: 2000
  };

  return (
    <div style={{ width: '80%', margin: '0 auto', padding: '20px 0' }}>
      <h2> Simple Slider </h2>
      <Slider {...settings}>
        <div><h3>1</h3></div>
        <div><h3>2</h3></div>
        <div><h3>3</h3></div>
        <div><h3>4</h3></div>
        <div><h3>5</h3></div>
        <div><h3>6</h3></div>
      </Slider>
    </div>
  );
}

view raw JSON →