Drawer

A modal edge panel that opens from the logical start or end of the frame.

A start drawer of real links that navigate in the page containing the preview.

Open in new tab

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

bash
suprnova live:add drawer

Usage

html
{% import "suprnova-ui/drawer/drawer.html" as drawer %}
{% call drawer::drawer_trigger("navigation", "Open navigation") %}{% endcall %}{% call drawer::drawer("navigation", "navigation", "Navigation") %}{% call drawer::drawer_close("navigation") %}{% endcall %}{% endcall %}

Examples

End drawer with search

An end drawer whose debounced query filters fixed subsystems on the server.

Open in new tab

Keyboard and accessibility

suprnova.drawer - a native modal drawer (OVL-001). drawer_trigger opens it and drawer_close closes it through the sn-drawer 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

drawer_trigger

ParameterDefaultDescription
targetRequiredThe modal's `id` to open locally.
textRequiredThe trigger's visible text.
variant"primary"The button variant: `primary`, `secondary`, `ghost` or `danger`.

drawer

ParameterDefaultDescription
idRequiredThe native dialog's `id`, also used to associate its title and triggers.
keyRequiredA stable `live:key` that preserves the browser-owned open state across compatible morphs.
titleRequiredThe visible heading, associated with the dialog through `aria-labelledby`.
side"start"The logical edge to open from: `start` or `end`.

drawer_close

ParameterDefaultDescription
targetRequiredThe 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`.