Skip to content

dialog

dialog(opts): Promise<void>

Defined in: components/dialog.ts:148

A dialog rendered into document.body via A.mount, with a dimming backdrop that fades in and out. Returns a Promise<void> that resolves when the dialog closes. Lifecycle is also tied to the parent reactive scope — when that scope is cleaned up the dialog disappears and the promise resolves.

Multiple dialogs stack correctly: each new pair (backdrop + dialog) has a higher z-index, while older dialogs are pushed behind their covering backdrop.

DialogOptions

Promise<void>

S.dialog({
header: "Confirm",
content: (close) => {
A("p #Are you sure?");
S.button({ content: "Yes", click: () => { S.alert("Nice!"); close(); } });
S.button({ content: "Cancel", attrs: ".neutral", click: close });
},
});