1.0.2 • Published 8 years ago

@wish.technology/react-slick v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

react-slick

Build Status

version downloads MIT License PRs Welcome Commitizen friendly semantic-release

The is a fork of react-slick. The purpose of this fork is to

  • slim down API surface,
  • reduce technical debt / complexity of the original project,
  • convert code to more recent ES2015/next style
  • rearchitect code to make it more unit-testable
  • use Travis && Code Coverage && semantic-release

It doesn't support bower anymore, arrow / dots elements are not provided.

This is a work in progress and not really ready for general production use.

Installation

  npm install react-slick

Example

const React = require('react');
const Slider = require('react-slick');
require('react-slick/slick.css');

const SimpleSlider = () => {
    const props = {
      dots: true,
      infinite: true,
      speed: 500,
      slidesToShow: 1,
      slidesToScroll: 1
    };
    return (
      <Slider {...props}>
        <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>
    );
  }

Note: This part of the README has not yet been updated after the fork. It's probably not really accurate right now.

PropertyTypeDescriptionWorking
classNameStringAdditional class name for the inner slider divYes
adaptiveHeightboolAdjust the slide's height automaticallyYes
arrowsboolShould we show Left and right nav arrowsYes
nextArrowReact ComponentUse this component for the next arrow buttonYes
prevArrowReact ComponentUse this component for the prev arrow buttonYes
autoplayboolShould the scroller auto scroll?Yes
autoplaySpeedintdelay between each auto scoll. in msYes
centerModeboolShould we centre to a single item?Yes
centerPadding
cssEase
dotsboolShould we show the dots at the bottom of the galleryYes
dotsClassstringClass applied to the dots if they are enabledYes
draggableboolIs the gallery scrollable via dragging on desktop?Yes
easingstring
fadeboolSlides use fade for transitionYes
focusOnSelectbool
infiniteboolshould the gallery wrap around it's contentsYes
initialSlideintwhich item should be the first to be displayedYes
lazyLoadboolLoads images or renders components on demandsYes
responsivearrayArray of objects in the form of { breakpoint: int, settings: { ... } } The breakpoint int is the maxWidth so the settings will be applied when resolution is below this value. Breakpoints in the array should be ordered from smalles to greatest. Use 'unslick' in place of the settings object to disable rendering the carousel at that breakpoint. Example: [ { breakpoint: 768, settings: { slidesToShow: 3 } }, { breakpoint: 1024, settings: { slidesToShow: 5 } }, { breakpoint: 100000, settings: 'unslick' } ]Yes
rtlboolReverses the slide orderYes
slidestring
slidesToShowintNumber of slides to be visible at a timeYes
slidesToScrollintNumber of slides to scroll for each navigation item
speedint
swipebool
swipeToSlidebool
touchMovebool
touchThresholdint
variableWidthbool
useCSSboolEnable/Disable CSS TransitionsYes
verticalbool
afterChangefunctioncallback function called after the current index changesYes
beforeChangefunctioncallback function called before the current index changesYes
slickGoTointgo to the specified slide number