A simple and fast React Native swipeble flatlist component. Supports both iOS and Android.
npm i --save rn-swipeable-flatlist
import SwipebleList from 'rn-swipeable-flatlist';
function MyListItem() {
return (
<View>
<SwipebleList
data={[1, 2, 3]}
duration={500}
renderItem={this.renderItem}
keyExtractor={this.keyExtractor}
leftColor={'green'}
rightColor={'blue'}
onSwipeLeft={this.onSwipe}
onSwipeRight={this.onSwipe}
/>
</View>
);
}
prop | type | default | description |
---|---|---|---|
swipeDistanceActive |
integer | 0.3 | swipeable distance for active swipe |
duration |
integer | 300 | swipe duration |
leftView |
renderable | null |
(optional) left content visible during pull action |
rightView |
renderable | null |
(optional) right content visible during pull action |
leftColor |
string | rgba(146, 149, 181, 0.7) | (optional) background color for left content |
rightColor |
string | rgba(132, 147, 158, 0.7) | (optional) background color for left content |
onSwipeLeft |
function | null |
(optional) user has swiped beyond swipeDistanceActive and released |
onSwipeRight |
function | null |
(optional) user has swiped beyond swipeDistanceActive and released |
For example used view Example/index.js file.
MIT