项目作者: MutatedBread

项目描述 :
A simple react swipable image carousel
高级语言: TypeScript
项目地址: git://github.com/MutatedBread/react-simple-image-carousel.git
创建时间: 2018-07-30T14:06:26Z
项目社区:https://github.com/MutatedBread/react-simple-image-carousel

开源协议:MIT License

下载


react-simple-image-carousel

react-simple-image-carousel is a image carousel component for react.

demo.png

You can customize :

  • Image slides
  • Direction buttons
  • Slide selector buttons
  • And etc

[ TODO ] Customize the animation.

Documentation at https://mutatedbread.github.io/react-simple-image-carousel

Installation

To get this package, run either :

  1. yarn add react-simple-image-carousel

or

  1. npm add react-simple-image-carousel --save

Simple Usage

Load into your files :

  1. import {Slider} from "react-simple-image-carousel"

Example :

  1. <Slider
  2. width={450}
  3. height={250}
  4. maxSwipeThreshold={250 * 0.15}
  5. minSwipeThreshold={40}
  6. swipeTimeThreshold={200}
  7. images={[
  8. "https://www.chewy.com/petcentral/wp-content/uploads/2018/05/lucky-corgi-butts-x-596-444x.jpg",
  9. "https://s3.amazonaws.com/cdn-origin-etr.akc.org/wp-content/uploads/2017/11/12225919/Pembroke-Welsh-Corgi-On-White-01.jpg",
  10. "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fb/Welchcorgipembroke.JPG/1200px-Welchcorgipembroke.JPG"
  11. ]}
  12. ></Slider>