ActionSheet
ActionSheets are sheets that slide up from the bottom of the screen, and present two or more choices related to an intentional user action.
Import
import { ActionSheet } from '@nomada-sh/react-native-eyecandy';
Example
Props
Requiredoptions
Type |
---|
ActionSheetOption[] |
visible
Type |
---|
boolean |
title
Type |
---|
string |
message
Type |
---|
string |
onClose
() => void;
Type |
---|
function |
onPressAction
(index: number) => void;
Type |
---|
function |
onCancel
() => void;
Type |
---|
function |
showCancelIcon
Type |
---|
boolean |
cancelText
Type | Default |
---|---|
string | 'Cancel' |
native
When set to true
, the action sheet will be rendered natively on iOS or Android.
Example
Type |
---|
boolean |
dark
iOS
When set to true
, the action sheet will be rendered in dark mode on iOS.
Type |
---|
boolean |
Type definitions
ActionSheetOption
Type |
---|
string, object |
When the type is string, the string is the label of the option.
When the type is object, the object must have the following properties:
Name | Type | Required | Description |
---|---|---|---|
label | string | Yes | The label of the option |
icon | Icon | No | The icon of the option |