Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@powerdesigninc/react-native-actionsheet
Advanced tools
Readme
Inspired by talut/rn-actionsheet-module.
This package will help you to using ActionSheet cross platform iOS(ActionSheetIOS) and Android(BottomSheetDialog).
Use the same way as ActionSheetIOS
, simply just change ActionSheetIOS to ActionSheet.
Android | iOS |
|
|
# with npm
npm install @powerdesigninc/react-native-actionsheet
# with yarn
yarn add @powerdesigninc/react-native-actionsheet
you don't need to link anything. Native Modules are now Autolinked
react-native link @powerdesigninc/react-native-actionsheet
import ActionSheet from "@powerdesigninc/react-native-actionsheet"
const App = () => {
return (
<View style={styles.container}>
<TouchableOpacity
style={styles.button}
onPress={() => {
ActionSheet.showActionSheetWithOptions(
{
title: 'Title',
message: 'message',
options: ['Cancel', 'From Gallery', 'From Camera'],
destructiveButtonIndex: 1,
cancelButtonIndex: 0,
},
index => {
switch (index) {
case 1:
Alert.alert('From Camera clicked');
break;
case 2:
Alert.alert('From Camera clicked');
break;
case 0:
Alert.alert('onCancel');
break;
default:
Alert.alert('Default');
break;
}
},
);
}}>
<Text>Show ActionSheet</Text>
</TouchableOpacity>
</View>
);
};
// same as ActionSheetIOSOptions
interface ActionSheetOptions {
title?: string;
options: string[];
cancelButtonIndex?: number;
destructiveButtonIndex?: number;
message?: string;
anchor?: number;
tintColor?: string;
hideCancelButton?: boolean; // if you don't want to show cancel on Android, but no effect on iOS
}
cd example
yarn install
yarn ios
yarn android
This project is licensed under the MIT License - see the LICENSE.md file for details
FAQs
React Native ActionSheet for Android (BottomSheetDialog) & IOS (ActionSheetIOS)
The npm package @powerdesigninc/react-native-actionsheet receives a total of 7 weekly downloads. As such, @powerdesigninc/react-native-actionsheet popularity was classified as not popular.
We found that @powerdesigninc/react-native-actionsheet demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.