1.0.1 • Published 5 years ago

@rn-components-kit/swipe-out v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

SwipeOut

NPM version

English | 中文

iOS-style swipe-out buttons that appear from behind a component. It supports the following features:

  • left and right two directions
  • multiple hidden buttons
  • fully customized hidden part

How to use

npm install @rn-components-kit/swipe-out --save
PreviewCode
Demo1 Code
Demo2 Code
Demo3 Code

Props

Reference

Props

style

Allow you to customizr style

TypeRequiredDefault
objectno-

left

The config for left hidden part. It supports followings:

  1. function() => React.ReactElement: allows you to fully customize the hidden component
  2. objectOption: a pre-setted style for button, you need to specify title, color and onPress
  3. 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
TypeRequiredDefault
() => React.ReactElement | Option | Option[] | nullno-

right

The config for right hidden part (same to left)

TypeRequiredDefault
() => React.ReactElement | Option | Option[] | nullno-

onBeginDragging

() => void

A callback will be triggered when you begin to drag SwipeOut

TypeRequiredDefault
functionno() => {}

onEndDragging

() => void

A callback will be triggered when dragging operation ends

TypeRequiredDefault
functionno() => {}