0.3.0 • Published 6 years ago

react-carousel-component v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

React-carousel-component

Carousel component for react

Usage

class Exemple extends React.Component {
  render () {
    const items = [1, 2, 3, 4, 5]

    const settings = {
      initialSlide: 3,
      beforeNext: _ => console.log('Next arrow clicked')
    }

    return (
      <ReactCarousel {...settings}>
        {items}
      </ReactCarousel>
    )
  }
}

Options

NameTypeDefaultDescription
autoScrollBooleanfalseAutomatically swipe
timerNumber4000Time to wait between two slides if autoScroll is enable
initialSlideNumber0Default slide to show
slideToShowNumber2Number of slides to be shown
slideToScrollNumber1Number of slides to scroll on slide
hideDotsBooleanfalseHide dots
transitionDurationNumber500Milliseconds of transition animation
gutterNumber0Percentage of space between slides
speedNumber500Milliseconds of transition animation
hideDotsBooleanfalseHide dots
beforePrevFunctionnullFunction called on click of left arrow before transition start
afterPrevFunctionnullFunction called on click of left arrow after the end of transition
beforeNextFunctionnullFunction called on click of right arrow before transition start
afterNextFunctionnullFunction called on click of right arrow after the end of transition
beforeSlideFunctionnullFunction called on click of arrows before transition start
afterSlideFunctionnullFunction called on click of arrows after the end of transition