1.0.4 • Published 7 years ago

rn-swipeable v1.0.4

Weekly downloads
2
License
-
Repository
github
Last release
7 years ago

rn-swipeable


Completely customizable swipeable component for react native. Supports both iOS and Android. Wrapped around react-native-swipe-out.

NPM version

Installation

npm install --save rn-swipeable

Usage

import Swipeable from 'rn-swipeable/lib';

<Swipeable
  left={[
    {
      text: 'reply',
      onPress:() => console.log('reply'),
      style: { backgroundColor: 'orange', color: 'white' },
      renderChildren: () => <View><Text> This is inside left children </Text></View>
    }
  ]}
  right={[
    {
      text: 'delete',
      onPress:() => console.log('delete'),
      style: { backgroundColor: 'red', color: 'white' },
      renderChildren: () => <View><Text> This is inside right children </Text></View>
    }
  ]}
  onOpen={() => console.log('open')}
  onClose={() => console.log('close')}
>
  <View style={{flex: 1, justifyContent: 'center'}}> This is inside the swipeable component </View>
</Swipeable>

API

props

namedescriptiontypedefault
styleswipeable styleObject
leftswipeable buttons on leftArray[]
rightswipeable buttons on rightArray[]
autoCloseauto close on button pressBooleanfunction() {}
onOpenFunctionfunction() {}
onCloseFunctionfunction() {}
disableddisabled swipeableBooleanfalse

button props

namedescriptiontypedefault
textbutton textStringClick
stylebutton styleObject
onPressbutton press functionFunctionfunction() {}

License

rn-swipeable is released under the MIT license.