FlatCarousel
a tiny carousel component for react.
Features
- no dependency
- support autoplay
- support touch and mouse device
- transition done with raf and tweening.
- infinite loop without duplicating the first&last item
Demo
Props
initialIndex?
: number, defaults to 0transitionDuration?
: number, defaults to 400msautoplay?
: boolean, defaults to trueautoplayInterval?
: number, defaults to 3000msinfiniteLoop?
: boolean, defaults to trueonPageChange?(index: number)
: void;