Duolith docs

ActionSheet

A short list of actions in a sheet from the bottom edge, with a cancel button.

Stability: experimental

Props

PropTypeDefaultMeans
titlestringWhat the actions are about, above them.
actions{ id: string; label: string; destructive?: boolean }[]The actions, in order; a destructive one is in the danger colour.
openbooleanbindable(false)Whether it shows. Bind it with bind:open={name}, or give it a trigger piece.
cancelstringCancelThe cancel button's label.
onChoose(id: string) => voidRuns with the chosen action's id, after the sheet closes.

Pieces

PieceMeans
triggerWhat opens it when pressed, such as a button.

States

StateLooks like
closedNothing but the trigger.
openA panel of actions over a scrim at the bottom edge, and a separate cancel button.

Accessibility

roledialog
nameThe title prop, or Actions.
focusMoves into the sheet when it opens, stays inside it, and returns to the trigger when it closes.
keyboardEscape closes it; Enter and Space press an action.

Theme tokens

color.scrim color.surface color.border color.primary color.danger color.muted space.2 space.3 space.4 text.body text.caption

Example

<ActionSheet title="Photo" actions={[{ id: "delete", label: "Delete", destructive: true }]} bind:open={open} onChoose={run} />