ActionSheet
Cross platform Action sheet that also support the native iOS solution.
PropTypes
Prop | Type | Description |
---|---|---|
visible | bool | Whether to show the action sheet or not |
title | string | Title of the action sheet |
message | string | Message of the action sheet |
cancelButtonIndex | number | Index of the option represents the cancel action |
destructiveButtonIndex | number | Index of the option represents the destructive action (usually used to delete items or abort important actions) |
options | array of type Button | List of options for the action sheet, follows the Button prop types |
onDismiss | func | callback for when dismissing the action sheet, usually used for setting visible prop to false |
useNativeIOS | bool | Should use the native action sheet for iOS |
Usage
<ActionSheet
title="Title"
message="Message of action sheet"
cancelButtonIndex={3}
destructiveButtonIndex={0}
options={[
{label: 'option 1', onPress: () => this.pickOption('option 1')},
{label: 'option 2', onPress: () => this.pickOption('option 2')},
{label: 'option 3', onPress: () => this.pickOption('option 3')},
{label: 'cancel', onPress: () => this.pickOption('cancel')},
]}
visible={showCustom}
onDismiss={() => this.setState({showCustom: false})}
/>