react-swipe-deck
v0.1.17
Published
Tinder style swipe deck
Downloads
50
Readme
react-swipe-card
Tinder style swipe cards
Usage
Install
$ npm install react-swipe-deck -save
Demo
Code
import Cards, { Card } from 'react-swipe-card'
const data = ['Alexandre', 'Thomas', 'Lucien']
const Wrapper = () => {
return (
<Cards onEnd={action('end')} className='master-root'>
{data.map(item =>
<Card
onSwipeLeft={action('swipe left')}
onSwipeRight={action('swipe right')}>
<h2>{item}</h2>
</Card>
)}
</Cards>
)
}
Components
Cards
Props:
- className: string
- onEnd: function
- alertRight: component
- alertLeft: component
- alertTop: component
- alertBottom: component
Card
Props:
- onSwipeLeft: function
- onSwipeRight: function
- onSwipeTop: function
- onSwipeBottom: function