1.1.0 • Published 7 years ago

react-native-swipeable-view v1.1.0

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

react-native-swipeable-view

This library allow you to create swipeable component, by exemple for a row in a list view, or anywhere you want. The code is based on the experimental SwipeableListView of react-native.

swipe

Installation

npm install --save react-native-swipeable-view

Usage example

import SwipeableView from 'react-native-swipeable-view';

// Buttons
var btnsArray = [
  {
    text: 'Button',
  },
];

// SwipeableView component
<SwipeableView btnsArray={ btnsArray }>
  <View>
    <Text>Swipe me left</Text>
  </View>
</SwipeableView>

Props

PropTypeOptionalDefaultDescription
isOpen        bool  YesfalseSwipeout is open or not
autoClose      bool  Yes    false  Auto-Close on button press
btnsArrayarrayNo[]Swipe buttons array
onOpenfuncYesCallback when swipe is opened
onClosefuncYesCallback when swipe is closed
onSwipeStart  func  Yes      Callback when swipe start
onSwipeEnd  func  Yes      Callback when swipe end
shouldBounceOnMountboolYesfalseBounce component on mount
swipeThresholdnumberYes30The minimum swipe distance required before fully animating the swipe
isRTLboolYesfalseTrue/false if the current language is right to left
Button props
PropTypeOptionalDefaultDescription
props          objectYes             Pass custom props to button component
component      stringYes    null  Pass custom component to button
onPressfuncYesnullFunction executed onPress
textstringYes'Click Me'Text
typestringYes'default'Default, primary, secondary

To Do

If you have any amelioration:

https://github.com/magrinj/react-native-swipeable-view/issues