Parameters
Badges Parameters
Success Callback
Code Example
Related APIs
my.confirm
Show confirmation dialog
my.alert
Show alert dialog
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Display an action sheet with multiple options.
| Property | Type | Required | Description |
|---|---|---|---|
| title | String | No | Action sheet title |
| items | Array | Yes | Array of option strings |
| cancelButtonText | String | No | Cancel button text. Invalid on Android, where the cancel button is not displayed |
| destructiveBtnIndex | Number | No | Index (starting from 0) of the button to mark as destructive, e.g. for delete/clear actions. Its default color is red |
| badges | Array | No | Array of badge objects used to show red marks on menu items |
| success | Function | No | Callback with selected index |
| fail | Function | No | Callback on failure |
| complete | Function | No | Callback that always executes |
| Property | Type | Description |
|---|---|---|
| index | Number | Index of the option to add a red mark to, starting from 0 |
| type | String | Red mark type. Valid values: none, point, num, text |
| text | String | Custom red mark text. Optional for none/point; for num, not displayed if the value has decimals or is not between 0-100 |
| Property | Type | Description |
|---|---|---|
| index | Number | Index of selected item (-1 if cancelled) |
my.showActionSheet({
title: 'Choose action',
items: ['Edit', 'Share', 'Delete'],
cancelButtonText: 'Cancel',
success: (res) => {
if (res.index !== -1) {
console.log('Selected:', res.index);
}
}
});