0.0.7 • Published 5 years ago

react-styled-touch-carousel v0.0.7

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

react-styled-touch-carousel

It is an often case that you need to display some items collection as a grid on large screens and as a carousel on small screens. So you want to have mobile-first(only?)-designed carousel to achieve that.

react-styled-touch-carousel - is a dead simple module without redundant dependencies for that cases. It is built with styled-components and using the flexbox order css-property to control the position of the items. So there is no shuffling the DOM elements around by javascript.

Usage

install:

yarn add react-styled-touch-carousel

or

npm i react-styled-touch-carousel --save

use:

import Carousel from 'react-styled-touch-carousel';

<Carousel interval={5000} autoplay>
  <div>Item 1</div>
  <div>Item 2</div>
  <div>Item 3</div>
  <div>Item 4</div>
</Carousel>;

API

Prop nameTypeDefaultDescription
autoplaybool, numberfalseUsed to make carousel auto play for every given time interval.
dotsbooltrueShow navigation dots
Dotnode--Customized nav dot which will get isCurrent as bool prop when its slide is visible
DotsWrappernode--Customized dots wrapper
afterSlidefunc--Some callback that will be called with direction argument after sliding is ended
beforeSlidefunc--Some callback that will be called with direction argument before sliding

Roadmap

  • autoplay

  • afterSlide and beforeSlide callbacks

  • add arrows

...

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago