ui-react.swipe
v1.1.4
Published
React swipe component
Downloads
5
Maintainers
Readme
(UI-React) Swipe
Installing as a package
npm i ui-react.swipe -S
or npm install ui-react.swipe --save
Demo
http://ui-react.github.io/ui-react.swipe
Development
git clone [email protected]:ui-react/ui-react.swipe.git
orgit clone https://github.com/ui-react/ui-react.swipe.git
npm i
ornpm install
- Building
npm run build
, Watchingnpm run watch
Getting started
import React, { Component } from 'react';
import { render } from 'react-dom';
import Swipe from 'ui-react.swipe';
class MyApp extends Component {
onSwipeStart = () => {
console.info('Swipe START!');
}
onSwipeLeft = () => {
console.info('Swipe LEFT!');
}
render() {
return(
<Swipe tagName="ul" axis="x" onSwipeStart={this.onSwipeStart} onSwipeLeft={this.onSwipeLeft}>
<li>My swipe block</li>
</Swipe>
)
}
}
render(<MyApp />, document.getElementById('my-app'));
Properties
- (String) tagName [default: 'div']
- (String) className
- (Object) style
- (String) axis
- (Number) minDelta
- (Function) onSwipeStart
- (Function) onSwipeMove
- (Function) onSwipeEnd
- (Function) onSwipeUp
- (Function) onSwipeDown
- (Function) onSwipeLeft
- (Function) onSwipeRight