Action Sheet
Offer a short list of actions in a group that slides up from the bottom of the screen, with a separate Cancel button below it.
Installation
Usage
[(open)]two-way binds a signal. Set it totrueto slide the sheet up.- Tapping an item emits its
pressed, then closes the sheet. You don't need to setopenyourself. - Tapping Cancel or the backdrop closes the sheet without emitting anything.
- The title and items stack in one rounded group.
<ui-action-sheet-cancel>always renders as its own tile below the group, wherever you put it. - Items and the title render their content in a
<text>, so put plain text in them. - The sheet draws in an
<overlay>, so it covers the whole screen wherever it sits in your template.
Destructive items
variant="destructive" colors an item's text red, for actions such as delete.
Navigate from an item
pressed fires inside the tap. Changing signals there is safe, but router navigation isn't: wrap it in setTimeout. See the setTimeout rule for why.
You can also wait for closed, which emits after the slide-down animation, from a timer.
Cancel label
API
UiActionSheet
UiActionSheetItem
UiActionSheetCancel
No outputs. Tapping it closes the sheet.
All sub-components (UiActionSheetTitle, UiActionSheetItem, UiActionSheetCancel) accept class. Items and Cancel only work inside a <ui-action-sheet>, because they close it.
Related
- Dialogs and overlays: how overlays work and which one to use
- Sheet: a panel from the bottom for any content
- Alert Dialog: confirm one action in a centered panel
- Bottom Sheet: a bare panel to lay out yourself
