Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rn-actionsheet-module

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rn-actionsheet-module

React Native ActionSheet for Android (BottomSheetDialog) & IOS (ActionSheetIOS)

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Native ActionSheet

This package will help you to using ActionSheetIOS(IOS) and BottomSheetDialog(Android).

Usage of this package same as for IOS and Android. Also this package usage same as ActionSheetIOS

Using ActionSheetIOS component for IOS and using RecyclerView and BottomSheetDialog for Android as NativeModule.

Version 1.0.4

  • tintColor added for Android
  • backgroundColor added for Android

Getting Started

With NPM

npm install --save rn-actionsheet-module

With YARN

yarn add rn-actionsheet-module

Automatic linking

react-native link rn-actionsheet-module

Manual Linking

Manual Installation (If something went wrong with react-native link)

Props

PropsTypeRequiredOS
optionsIOSarrayYesIOS
optionsAndroidarrayYesAndroid
titlestringYesAndroid, IOS
messagestringNoIOS
tintColorstringNoIOS, Android
backgroundColorstringNoAndroid
destructiveButtonIndexnumberNoIOS
cancelButtonIndexnumberNoIOS
onCancelAndroidIndexnumberYesAndroid
With v0.2.0

Android doesn't need any cancel option but back button or outside click will return onCancelAndroidIndex

Usage

import ActionSheet from 'rn-actionsheet-module'

<TouchableOpacity onPress={() => {
   ActionSheet(
       {
          title             : "Lorem ipsum",
          optionsIOS        : ["Cancel", "From Gallery", "From Camera"],
          optionsAndroid        : ["From Gallery", "From Camera"],
          destructiveButtonIndex: null, // undefined // 1, 2, etc.,
          cancelButtonIndex     : 0, // 
          onCancelAndroidIndex: 3 // android doesn't need any cancel option but back button or outside click will return onCancelAndroidIndex
       }, (index) => {
        switch (index) {
         case Platform.OS === "ios" ? 1 : 0 :{
           alert("From Camera clicked")
         }
         case Platform.OS === "ios" ? 2 : 1 :{
           alert("From Camera clicked")
         }
         case Platform.OS === "ios" ? 0 : 3 :{
           alert("onCancel")
         }
         default:{
           alert("Default")
         }
        }
       }
   )
}}>
  <Text>Show ActionSheet</Text>
</TouchableOpacity>

FYI

You can use more than one ActionSheet in same screen.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Keywords

FAQs

Package last updated on 28 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc