<tap-action-sheet>
Action Sheet component. Slides up from the bottom of the screen, allowing users to choose between multiple actions.
Example
Loading...
<tap-action-sheet
.heading=${"Choose Action"}
.description=${"Please choose an action to perform on this item"}
.groups=${ [ { "actions": [ {"label":"Share to Friends"}, {"label":"Add to Favorites"}, {"label":"Delete","danger":true} ] } ] }
.cancel=${true}></tap-action-sheet>
Imperative Calling
import { ActionSheet } from '@mantou/tap-ui/elements/action-sheet';
await ActionSheet.open({
heading: 'Share',
groups: [
{
actions: [
{ label: 'Copy Link', onClick: () => console.log('copy') },
{ label: 'Delete', danger: true, onClick: () => console.log('delete') },
],
},
],
cancel: true,
});API
Shadow DOM; Extends GemElement
Static Methods
| Method | Type |
|---|---|
open |
<T = unknown>(options: ActionSheetOptions<T>) => DyPromise<ActionSheetAction<T> | undefined, { actionSheet: TapActionSheetElement<T>; sheet: TapSheetElement; }> & ... |
Instance Properties
| Property(Attribute) | Reactive | Type |
|---|---|---|
cancelText(cancel-text) |
Yes | string |
mode(mode) |
Yes | ActionSheetMode |
heading |
Yes | string | TemplateResult |
description |
Yes | string | TemplateResult |
actions |
Yes | ActionSheetAction<T>[] |
groups |
Yes | ActionSheetGroup<T>[] |
select |
Emitter<ActionSheetAction<T>> |
|
cancel |
Emitter |
Other
| Type | Value |
|---|---|
| Event | select, cancel |
| Part | header, heading, description, group, group-label, action, cancel |
