react-native link @powerdesigninc/react-native-actionsheet
Example
importActionSheetfrom"@powerdesigninc/react-native-actionsheet"constApp=()=>{return(<Viewstyle={styles.container}><TouchableOpacitystyle={styles.button}onPress={()=>{ActionSheet.showActionSheetWithOptions({title: 'Title',message: 'message',options: ['Cancel','From Gallery','From Camera'],destructiveButtonIndex: 1,cancelButtonIndex: 0,},index=>{switch(index){case1:
Alert.alert('From Camera clicked');break;case2:
Alert.alert('From Camera clicked');break;case0:
Alert.alert('onCancel');break;default:
Alert.alert('Default');break;}},);}}><Text>Show ActionSheet</Text></TouchableOpacity></View>);};
Options
// same as ActionSheetIOSOptionsinterfaceActionSheetOptions{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}
Run Example Project
cd example
yarn install
yarn ios
yarn android
License
This project is licensed under the MIT License - see the LICENSE.md file for details