Get started with react-slick CDN

MIT licensed

React-Slick is a popular React library for creating responsive and customizable carousels and sliders.

Tags:
  • slick
  • carousel
  • Image slider
  • orbit
  • slider
  • react-component

Stable version

Copied!

How to start using react-slick CDN


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

const SampleNextArrow = ({ onClick }) => {
  return (
    <div className="slick-next" onClick={onClick}>
      <button>Next</button>
    </div>
  );
};

const SamplePrevArrow = ({ onClick }) => {
  return (
    <div className="slick-prev" onClick={onClick}>
      <button>Previous</button>
    </div>
  );
};

const Carousel = () => {
  const settings = {
    dots: false,
    infinite: true,
    speed: 500,
    slidesToShow: 1,
    slidesToScroll: 1,
    nextArrow: <SampleNextArrow />,
    prevArrow: <SamplePrevArrow />,
  };

  return (
    <div>
      <Slick {...settings}>
        <div>
          <h3>1</h3>
        </div>
        <div>
          <h3>2</h3>
        </div>
        <div>
          <h3>3</h3>
        </div>
      </Slick>
    </div>
  );
};

export default Carousel;
Copied!
Copied!

All versions