1.0.1 • Published 6 years ago
@rn-components-kit/swipe-out v1.0.1
SwipeOut
English | 中文
iOS-style swipe-out buttons that appear from behind a component. It supports the following features:
leftandrighttwo directions- multiple hidden buttons
- fully customized hidden part
How to use
npm install @rn-components-kit/swipe-out --save| Preview | Code |
|---|---|
| Demo1 Code | |
| Demo2 Code | |
| Demo3 Code |
Props
Reference
Props
style
Allow you to customizr style
| Type | Required | Default |
|---|---|---|
| object | no | - |
left
The config for left hidden part. It supports followings:
- function() => React.ReactElement: allows you to fully customize the hidden component
- objectOption: a pre-setted style for button, you need to specify
title,colorandonPress - array[Option[]]: multiple buttons
Option:
- titlestring: text to display in button
- colorstring: background color of button
- onPressfunction: callback will be triggered when pressing the button
| Type | Required | Default |
|---|---|---|
| () => React.ReactElement | Option | Option[] | null | no | - |
right
The config for right hidden part (same to left)
| Type | Required | Default |
|---|---|---|
| () => React.ReactElement | Option | Option[] | null | no | - |
onBeginDragging
() => voidA callback will be triggered when you begin to drag SwipeOut
| Type | Required | Default |
|---|---|---|
| function | no | () => {} |
onEndDragging
() => voidA callback will be triggered when dragging operation ends
| Type | Required | Default |
|---|---|---|
| function | no | () => {} |