1.0.4 • Published 6 years ago

rc-swipe v1.0.4

Weekly downloads
39
License
MIT
Repository
github
Last release
6 years ago

Swipe

Swipe Component for react.

Built on top of hscroll

Build with webpack

Story book

Features

  • Responsive, children width automatically adjusted.
  • Customize style easily, no default styles.
  • Support wheel event, mousemove event and touchmove event.
  • Driven by props, play/stop support.
  • User friendly, buildin fast swipe check.
  • No conflit with transition property on children.

TODO

  • Infinite loop

Install

npm i rc-swipe -S

Usage

<Swipe style={boxStyles}>
  <div>one</div>
  <div>two</div>
  <div>three</div>
</Swipe>

Props

nametypedefaultdescription
playboolfalsePlaying status
intervalnumber2000Play interval in miliseconds
activenumber0Current active item index
thresholdnumber200Maximun duration in ms for fast swipe
fastThreshold:number15minimum moved distance for fast swipe
durationnumber200duration for transition
onShowfuncnullcallback function called with active index after active element changed

Remember use onShow to sync active property if you change swipe state by props

You can also have className style props for swipe element.

License

MIT

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.2.0

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago