1.0.0 • Published 5 years ago

rn-swipeable-flatlist v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

React Native Swipeable FlatList NPM version

A simple and fast React Native swipeble flatlist component. Supports both iOS and Android.

Installation

npm i --save rn-swipeable-flatlist

Usage

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>
    );
}

Props

proptypedefaultdescription
swipeDistanceActiveinteger0.3swipeable distance for active swipe
durationinteger300swipe duration
leftViewrenderablenull(optional) left content visible during pull action
rightViewrenderablenull(optional) right content visible during pull action
leftColorstringrgba(146, 149, 181, 0.7)(optional) background color for left content
rightColorstringrgba(132, 147, 158, 0.7)(optional) background color for left content
onSwipeLeftfunctionnull(optional) user has swiped beyond swipeDistanceActive and released
onSwipeRightfunctionnull(optional) user has swiped beyond swipeDistanceActive and released

Example

For example used view Example/index.js file.

License

MIT