1.0.1 • Published 6 years ago

react-native-swipe-del v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

react-native-swipe-del

npm.io npm.io npm.io

Sample

Image

Introduction

react-native-swipe-del is based on reactNative, the aim is to provide the ability to swipe left and delete item.

Feature

  • animation
  • compatible(ios and adr)

Installation

npm install --save react-native-swipe-del

Usage

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 */
import React, { Component } from 'react';
import { View, Text, StyleSheet, AppRegistry, Alert } from 'react-native';
import { SwipeDel } from 'react-native-swipe-del';

class Demo extends Component {
    
    render() {
        return (
            <SwipeDel style={{marginTop: 20}} handleDelete={() => {
                Alert.alert('Alert Title', null,[
                    {text: 'Cancel', onPress: () => console.log('Cancel Pressed')},
                    {text: 'OK', onPress: () => console.log('OK Pressed')}
                ]);
            }}>
                {/*item content*/}
                <View style={styles.itemWrap}>
                    <Text style={styles.itemText}>item content</Text> 
                </View>
            </SwipeDel>
        );
    }
}

const styles = StyleSheet.create({
    itemWrap: {
        backgroundColor: '#FFF5DB',
        alignItems: 'center',
        paddingVertical: 40
    },
    itemText: {
        color: '#9D7618'
    }
});

AppRegistry.registerComponent('Demo', () => Demo);