1.2.0 • Published 7 years ago

react-apple-carousel v1.2.0

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

react-apple-carousel

Installing

$ npm install react-apple-carousel --save

Demos

Usage

<AppleCarousel
  renderSlides={[
    ({ activeItemIndex, index }) => <Slide1 isActive={index === activeItemIndex} />,
    ({ slide }) => <Slide2 animationValue={slide} />,
    () => <Slide3 />,
    () => <Slide4 />,
  ]}
/>
PropertyTypeDefaultDescription
renderSlides*arrayOf (func)Array of functions that gets called with the following object to helpyou build a prallax animation.index: Integer Index of the slideslide: Number Number between 0 and slides.length. use this to make the parallax animation.activeItemIndex: Integer The current active item indexcontainerWidth: Number The container width
springConfigshape {stiffness: numberdamping: number}presets.noWobbleReact motion configurations.More about this here
breakPointRationumber0.5Number between 0 and 1 used to see if the slide should be turned or not.For example setting this at 0.1 will switch the slide with the slightestuser move.
activeItemIndexnumber0Use this to set the active item index at mount.
onActiveItemChangefuncCalled when the active item change passing the item index
indicatorsBottomnumber30Indicators bottom absolute position.
enableTimerbooltrueWhether or not to enable timer.
timerIntervalnumber3000Only available if enableTimer is true.
enableIndicatorsbooltrueIf true we will render default indicators that matches apple design.

Contributing

To contribute, follow these steps:

  • Fork this repo.
  • Clone your fork.
  • Run npm install
  • Run npm start
  • Goto localhost:3000
  • Add your patch then push to your fork and submit a pull request

License

MIT