react-slick README

The project's README from github.com/akiran/react-slick. As one markdown file: README.md.

react-slick

Backers on Open Collective Sponsors on Open Collective

Documentation

Installation

npm

npm install react-slick --save

yarn

yarn add react-slick

Also 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"
/>

PlayGround

Example

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}>
      <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>
  );
}

Props

For all available props, go here.

Methods

For all available methods, go here

Development

Want to run demos locally

git clone https://github.com/akiran/react-slick
cd react-slick
npm install
npm start
open http://localhost:8080

Community

Join our discord channel to discuss react-slick bugs and ask for help

Contributing

Please see the contributing guidelines

react-slick (akiran/react-slick)

Searching Database…

What is this?react-slick is a carousel component for React, built as a React port of the popular Slick Carousel library.
Is it a UI library or a full framework?It's a single React component library focused on rendering carousels/sliders, not a framework.
How do I add it to a project?Install it via npm or yarn, then also install slick-carousel for the CSS and font assets (or link them via CDN in your HTML).
Do I need any other packages besides react-slick itself?Yes — besides React itself, it depends on classnames, json2mq, lodash.debounce and resize-observer-polyfill, and you still need the separate slick-carousel package for styling.
Any install pitfalls I should know about?The CSS/fonts aren't bundled in react-slick itself, so if you skip installing slick-carousel or linking its CDN assets, the carousel will render without proper styling or arrow/dot icons.
Where can I see all the configurable props and methods?The README links to dedicated pages listing all available props and all available methods, plus a PlayGround and Example section to try it live.
How do I run the demos locally for development?There's a local development setup for running demos; the package.json includes scripts like 'start' and 'demo' that launch a gulp-based server to preview examples.
Is there a community place to ask questions?Yes, the project has a Discord channel for discussing bugs and getting help with react-slick.
Creator
akiran
Size
2.3 MB
Stars
11.9K
Age
11y
Commits · 90 Days