Dialog
A native modal dialog with a title, local triggers and focus return.
Opening, closing and Escape stay local; focus returns to the trigger.
Each preview is its own Live page in a frame, because this site is a Vue 3.5 app built on the Pulsar starter kit. An open list or popover stays inside its frame; in your application it opens over the page.
Installation
suprnova live:add dialogUsage
{% import "suprnova-ui/dialog/dialog.html" as dialog %}
{% call dialog::dialog_trigger("about", "About") %}{% endcall %}{% call dialog::dialog("about", "about", "About this app") %}{% call dialog::dialog_close("about") %}{% endcall %}{% endcall %}Examples
Server confirmation
Archive a demo in your island; the dialog stays open to show the server answer.
Keyboard and accessibility
suprnova.dialog - a native modal dialog (OVL-001). dialog_trigger opens it and dialog_close closes it through the sn-dialog element; the dialog element owns the open state, focus containment and Escape, and focus returns to the trigger on close (OVL-005). Keyed and preserved across a compatible morph (OVL-006). The host carries tabindex="-1" so it can take focus when the trigger has left the document.
API reference
dialog_trigger
| Parameter | Default | Description |
|---|---|---|
target | Required | The modal's `id` to open locally. |
text | Required | The trigger's visible text. |
variant | "primary" | The button variant: `primary`, `secondary`, `ghost` or `danger`. |
dialog
| Parameter | Default | Description |
|---|---|---|
id | Required | The native dialog's `id`, also used to associate its title and triggers. |
key | Required | A stable `live:key` that preserves the browser-owned open state across compatible morphs. |
title | Required | The visible heading, associated with the dialog through `aria-labelledby`. |
dialog_close
| Parameter | Default | Description |
|---|---|---|
target | Required | The modal's `id` to close locally, returning focus to its invoker. |
text | "Close" | The close button's visible text. |
variant | "secondary" | The button variant: `primary`, `secondary`, `ghost` or `danger`. |
