OGE logoOGE

Action Sheet

oge-action-sheet is the mobile list of actions that slides up from the bottom edge — "Share, Edit, Delete, Cancel".

It is a modal role="dialog" labelled by its title and moved to <body> while open, with the overlay family's shared behaviour: focus trap, ref-counted scroll lock, an inert background, the Escape stack, backdrop and swipe-down dismissal and focus restore. The actions are a WAI-ARIA APG menu with one tab stop; Cancel is a separate button. On phones the sheet spans the screen and pads its bottom edge with env(safe-area-inset-bottom); on wider screens it floats.

bottom sheet APG menu swipe to close safe areas

Basics

Each action has a label, an optional icon (SVG path data) and an optional description; destructive paints it in the danger colour — say it in the text too. ↑/↓ wrap, Home / End jump, Enter or Space choose. Choosing an action closes the sheet and focus returns to the button that opened it.

open() title description items itemClick

Last action: none

Groups, disabled actions & templates

group: 'bottom' actions render after a divider. Disabled actions stay focusable, so a screen reader user learns they exist, but never run. [ogeActionSheetItemTemplate] replaces the icon and text; the menu item button, its keyboard and its state stay with the sheet.

group: bottom disabled ogeActionSheetItemTemplate

Promise API & events

open() resolves with the chosen action, or null when the sheet was dismissed. itemClick can set keepOpen, and the cancelable closing event — with its reason: action, cancel, escape, backdrop, swipe or api — can veto a close.

await open() keepOpen closing cancel

Nothing chosen yet