All Projects → beefe → React Native Actionsheet

beefe / React Native Actionsheet

Licence: mit
An elegant ActionSheet component for React Native.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Actionsheet

actionsheet-android
iPad-style ActionSheet for Android
Stars: ✭ 21 (-98.23%)
Mutual labels:  actionsheet
React Native Actions Sheet
A Cross Platform(Android & iOS) ActionSheet with a flexible api, native performance and zero dependency code for react native. Create anything you want inside ActionSheet.
Stars: ✭ 412 (-65.32%)
Mutual labels:  actionsheet
Lgalertview
Customizable implementation of UIAlertViewController, UIAlertView and UIActionSheet. All in one. You can customize every detail. Make AlertView of your dream! :)
Stars: ✭ 1,027 (-13.55%)
Mutual labels:  actionsheet
iakit
无依赖 mini 组件库,只封装了 alert, toast, loading, actionSheet 等使用频率较高的组件。适用于类似 H5 活动页的简单移动端项目,不必为了使用这些组件而引入一个大而全的 UI 库和框架。
Stars: ✭ 38 (-96.8%)
Mutual labels:  actionsheet
Tltransitions
快速实现控制器的转场和View的快速popover显示,并支持自定义动画、手势退场
Stars: ✭ 296 (-75.08%)
Mutual labels:  actionsheet
Swiftentrykit
SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.
Stars: ✭ 5,706 (+380.3%)
Mutual labels:  actionsheet
react-native-general-actionsheet
ActionSheet api on iOS and Android same as ActionSheetIOS.
Stars: ✭ 23 (-98.06%)
Mutual labels:  actionsheet
Popmenu
A fully customizable popup style menu for iOS 😎
Stars: ✭ 1,155 (-2.78%)
Mutual labels:  actionsheet
Uiwidget
一个集成TabLayout、UIAlertDialog、UIActionSheetDialog、UIProgressDialog、TitleBarView(自带沉浸式标题栏)、CollapsingTitleBarLayout、RadiusView(圆角及状态背景设置View解放shape文件)、KeyboardHelper(软键盘控制及遮挡控制类)、StatusViewHelper(状态栏沉浸帮助类)、NavigationViewHelper(导航栏沉浸式帮助类)、AlphaViewHelper(View透明度控制帮助类) 等项目常用UI库
Stars: ✭ 400 (-66.33%)
Mutual labels:  actionsheet
Tbactionsheet
A Custom&Powerful Action Sheet For iOS. 一个 ActionSheet 满足所有样式!超高自由度的可定制!
Stars: ✭ 942 (-20.71%)
Mutual labels:  actionsheet
HJCActionSheet
Like Wechat ActionSheet Demo
Stars: ✭ 12 (-98.99%)
Mutual labels:  actionsheet
Sheet
📑 Actionsheet with navigation features such as the Flipboard App
Stars: ✭ 264 (-77.78%)
Mutual labels:  actionsheet
Lcactionsheet
一款简约而不失强大的 ActionSheet,微博、微信和 QQ 都采用了极其类似的样式,完全支持 Swift。
Stars: ✭ 809 (-31.9%)
Mutual labels:  actionsheet
TezActionSheet
Custom singleton actionSheet with block completion.
Stars: ✭ 18 (-98.48%)
Mutual labels:  actionsheet
Leealert
优雅的可自定义 Alert ActionSheet
Stars: ✭ 1,097 (-7.66%)
Mutual labels:  actionsheet
react-native-wxui
A UI package for React Native
Stars: ✭ 21 (-98.23%)
Mutual labels:  actionsheet
Easyshowview
一款非常简单的展示工具。提示框,加载框,空白页提示,alert弹出框。一行代码搞定所有操作。
Stars: ✭ 447 (-62.37%)
Mutual labels:  actionsheet
Sheeeeeeeeet
Sheeeeeeeeet is a Swift library for creating menus, custom action sheets, context menus etc.
Stars: ✭ 1,177 (-0.93%)
Mutual labels:  actionsheet
Hdalertview
A similar system UIAlertView
Stars: ✭ 61 (-94.87%)
Mutual labels:  actionsheet
Mxactionsheet
actionSheet something like weChat
Stars: ✭ 17 (-98.57%)
Mutual labels:  actionsheet

react-native-actionsheet

Cross platform ActionSheet. This component implements a custom ActionSheet and provides the same way to drawing it on the defferent platforms(iOS and Android). Actually, In order to keep the best effect, it still uses the ActionSheetIOS on iOS.

Install

npm install react-native-actionsheet --save

Usage

import ActionSheet from 'react-native-actionsheet'

class Demo extends React.Component {
  showActionSheet = () => {
    this.ActionSheet.show()
  }
  render() {
    return (
      <View>
        <Text onPress={this.showActionSheet}>Open ActionSheet</Text>
        <ActionSheet
          ref={o => this.ActionSheet = o}
          title={'Which one do you like ?'}
          options={['Apple', 'Banana', 'cancel']}
          cancelButtonIndex={2}
          destructiveButtonIndex={1}
          onPress={(index) => { /* do something */ }}
        />
      </View>
    )
  }
}

Use ActionSheetCustom directly

so you can customize option and title

import { ActionSheetCustom as ActionSheet } from 'react-native-actionsheet'

const options = [
  'Cancel', 
  'Apple', 
  <Text style={{color: 'yellow'}}>Banana</Text>,
  'Watermelon', 
  <Text style={{color: 'red'}}>Durian</Text>
]

class Demo extends React.Component {
  showActionSheet = () => {
    this.ActionSheet.show()
  }
  render() {
    return (
      <View>
        <Text onPress={this.showActionSheet}>Open ActionSheet</Text>
        <ActionSheet
          ref={o => this.ActionSheet = o}
          title={<Text style={{color: '#000', fontSize: 18}}>Which one do you like?</Text>}
          options={options}
          cancelButtonIndex={0}
          destructiveButtonIndex={4}
          onPress={(index) => { /* do something */ }}
        />
      </View>
    )
  }
}

How to redesign style ?

The style of ActionSheet is defined in lib/styles.js. We can pass the styles prop to cover default style. See Example .

// example

const styles = {
  titleBox: {
    background: 'pink'
  },
  titleText: {
    fontSize: 16,
    color: '#000'
  }
}

<ActionSheet
  ...
  styles={styles}
/>

Props

https://github.com/beefe/react-native-actionsheet/blob/master/lib/options.js

Prop name Description Type Default
title PropTypes.string or PropTypes.element
message PropTypes.string or PropTypes.element
options PropTypes.arrayOf([PropTypes.string, PropTypes.element])
tintColor PropTypes.string
cancelButtonIndex PropTypes.number
destructiveButtonIndex PropTypes.number
onPress PropTypes.func (index) => {}
styles only for ActionSheetCustom {}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].