1.0.4 • Published 7 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 -SUsage
<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
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
8 years ago
1.0.0
8 years ago
0.2.0
10 years ago
0.1.7
10 years ago
0.1.6
10 years ago
0.1.5
10 years ago
0.1.3
10 years ago
0.1.2
10 years ago
0.1.1
10 years ago
0.1.0
10 years ago
0.0.11
10 years ago
0.0.10
10 years ago
0.0.9
10 years ago
0.0.8
10 years ago
0.0.7
10 years ago
0.0.6
10 years ago
0.0.5
10 years ago
0.0.4
10 years ago
0.0.3
10 years ago
0.0.2
10 years ago