react-native-swipeout

iOS-style swipeout buttons behind component

  • 所有者: dancormier/react-native-swipeout
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

DEPRECATED

this is no longer supported, please consider using https://github.com/jemise111/react-native-swipe-list-view instead.

react-native-swipeout

iOS-style swipeout buttons that appear from behind a component

swipeout preview

Installation

npm install --save react-native-swipeout

Usage example

See example/index.ios.js for a more detailed example.
See the Wiki usage tips.
To use swipeout behind a iOS-style listitem, try react-native-listitem.

import Swipeout from 'react-native-swipeout';

// Buttons
var swipeoutBtns = [
  {
    text: 'Button'
  }
]

// Swipeout component
<Swipeout right={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', close, bool, Yes, close swipeout
disabled, bool, Yes, false, whether to disable the swipeout
left, array, Yes, [], swipeout buttons on left
onOpen, func, Yes, (sectionID, rowId, direction: string) => void
onClose, func, Yes, (sectionID, rowId, direction: string) => void
right, array, Yes, [], swipeout buttons on right
scroll, func, Yes, prevent parent scroll
style, style, Yes, style of the container
sensitivity, number, Yes, 50, change the sensitivity of gesture
buttonWidth, number, Yes, each button width

Button props

Prop, Type, Optional, Default, Description
---------------, ------, --------, ---------, -----------
backgroundColor, string, Yes, '#b6bec0', background color
color, string, Yes, '#ffffff', text color
component, ReactNode, 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, delete, primary, secondary
underlayColor, string, Yes, null, button underlay color on press
disabled, bool, Yes, false, disable button

To Do

https://github.com/dancormier/react-native-swipeout/issues

主要指标

概览
名称与所有者dancormier/react-native-swipeout
主编程语言JavaScript
编程语言Objective-C (语言数: 4)
平台
许可证MIT License
所有者活动
创建于2015-05-28 03:00:42
推送于2020-09-16 16:57:25
最后一次提交2020-09-16 12:57:24
发布数0
用户参与
星数2.6k
关注者数48
派生数647
提交数253
已启用问题?
问题数239
打开的问题数93
拉请求数46
打开的拉请求数15
关闭的拉请求数45
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?