1.0.4 • Published 6 years ago
rc-swipe v1.0.4
Swipe
Swipe Component for react.
Built on top of hscroll
Build with webpack
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
name | type | default | description |
---|---|---|---|
play | bool | false | Playing status |
interval | number | 2000 | Play interval in miliseconds |
active | number | 0 | Current active item index |
threshold | number | 200 | Maximun duration in ms for fast swipe |
fastThreshold: | number | 15 | minimum moved distance for fast swipe |
duration | number | 200 | duration for transition |
onShow | func | null | callback 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