mirror of
https://github.com/zhigang1992/react-native-swipeout.git
synced 2026-04-28 12:25:19 +08:00
3438ce0c2af84e4d0e1dbe2f0e6644c2e53bb119
react-native-swipeout
iOS-style swipeout buttons that appear from behind a component

Installation
npm install --save react-native-swipeout
Usage example
note: see example/index.ios.js for more detailed example
var Swipeout = require('react-native-swipeout')
// Buttons
var swipeoutBtns = [
{
text: 'Button'
}
]
// Swipeout component
<Swipeout btns={swipeoutBtns}>
<View>
<Text>Swipe me left</Text>
</View>
</Swipeout>
Props
| Prop | Type | Optional | Default | Description |
|---|---|---|---|---|
| autoClose | bool | Yes | false | auto close on button press |
| backgroundColor | string | Yes | '#dbddde' | |
| btns | array | No | [] | swipeout buttons |
Button props
| Prop | Type | Optional | Default | Description |
|---|---|---|---|---|
| backgroundColor | string | Yes | '#b6bec0' | background color |
| color | string | Yes | '#ffffff' | text color |
| component | string | Yes | null | pass custom component to button |
| onPress | func | Yes | null | function executed onPress |
| text | string | Yes | 'Click Me' | text |
| type | string | Yes | 'default' | default, primary, secondary |
To Do
Languages
JavaScript
64.2%
Objective-C
20.5%
Starlark
8.3%
Java
7%