Skip to content

gnato/react-flex-carousel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-flex-carousel

A simple responsive Carousel powered by React and CSS Flexbox

You can also try nuka-carousel if needed more features.

Feature

  • Support swipe touch gesture
  • CSS style customization

Usage

<Carousel autoPlayInterval={4500} indicator={true} switcher={true}>
	<div></div>
	<div></div>
	<div></div>
</Carousel>

Props

  • className:

    class name on Carousel for CSS styling, default is slider

  • autoPlayInterval:

    set inteval number in ms to enable carousel autoplay

  • transitionDuration:

    CSS transition-duration, default is .8s

  • transitionTimingFunction:

    CSS transition-timing-function, default is ease-in-out

  • switcher:

    toggle to show the prev/next buttons, default is false

  • indicator:

    toggle to show the indicator dots, default is false

  • slideWillChange(newSlideIndex, currentSlideIndex):

    hook function before slide transition, return false could cancel transition.

  • slideDidChange(newSlideIndex):

    hook function after slide transition.

Then apply your style, take slider.css for reference.

Demo

Install nwb, then nwb react run example.js to see the demo.

License

MIT

About

A simple responsive Carousel powered by React and CSS Flexbox

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 86.7%
  • CSS 13.3%