1.0.2 • Published 8 months ago

react-snap-infinite-carousel v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

react-snap-infinite-carousel

Smooth infinite carousel with css-scroll-snap - implemented with custom animation function

Example

npm.io

Install

npm install react-snap-infinite-carousel --save

If you prefer yarn then

yarn react-snap-infinite-carousel

Props

PropertyTypeDefaultDescription
childern (required)React elements[]Words to type
autoScrollbooleantrueAuto scroll the carousel
infiniteScrollbooleantrueInfinite scrolling
intervalnumber4Time between changing slides in seconds
transitionTimenumber1500Slide scroll transition time in ms
easingFunctionstring'ease'Animation easing function - 'linear''ease''easeIn''easeOut''easeInOut'

Usage

import React from 'react'
import InfiniteCarousel from 'react-snap-infinite-carousel';


const Example = () => {
  return <InfiniteCarousel>
        <ImgWrapper>
          <div>1</div>
          <Image src={img} alt="" />
        </ImgWrapper>
        <ImgWrapper>
          <div>2</div>
          <Image src={img} alt="" />
        </ImgWrapper>
        <ImgWrapper>
          <div>3</div>
          <Image src={img} alt="" />
        </ImgWrapper>
      </InfiniteCarousel>
}

export default Example;

License

MIT © mamanico1