react-swipe-carousel

1.0.2 • Public • Published

React Swipe Carousel

Browser native swipe friendly carousel.

  • Uses browser overflow:auto
  • Responsive
  • Mobile friendly
  • Keyboard support
  • Accessible
  • Server side friendly
  • Requires requestAnimationFrame and Promise polyfill

Docs & Demo: https://rmdort.github.io/react-swipe-carousel/

Installation

yarn add react-swipe-carousel

Usage

const images = [
  'https://placeimg.com/640/480/any',
  'https://placeimg.com/640/480/animals'
];
<Carousel>
  {images.map((img, idx) => <img src={img} key={idx} />)}
</Carousel>

Custom width

const images = [
  'https://placeimg.com/100/100/any',
  'https://placeimg.com/100/100/animals',
  'https://placeimg.com/100/100/animals',
  'https://placeimg.com/100/100/animals',
  'https://placeimg.com/100/100/animals',
  'https://placeimg.com/100/100/animals',
  'https://placeimg.com/100/100/animals',
  'https://placeimg.com/100/100/animals',
  'https://placeimg.com/100/100/animals'
];
<Carousel itemWidth={100}>
  {images.map((img, idx) => <img src={img} key={idx} />)}
</Carousel>

Readme

Keywords

none

Package Sidebar

Install

npm i react-swipe-carousel

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

789 kB

Total Files

11

Last publish

Collaborators

  • rmdort