Collapsible

A native disclosure whose browser-owned open state survives compatible morphs.

A native disclosure that opens and closes without a server request.

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 collapsible

Usage

html
{% import "suprnova-ui/collapsible/collapsible.html" as collapsible %}
{% call collapsible::collapsible("details", "More details") %}<p>Additional information.</p>{% endcall %}

Examples

Server refresh

Refresh the content on the server while the keyed disclosure keeps its open state.

Open in new tab

Keyboard and accessibility

suprnova.collapsible - one native disclosure (OVL-001). The details element owns the open state; the key names a stable morph scope and live:preserve.self keeps the browser's open state across a compatible morph (OVL-006). live:key is the one key attribute a template writes: the checker validates it and the runtime reads it (LIVE-024).

API reference

collapsible

ParameterDefaultDescription
keyRequiredA stable `live:key` that preserves the browser-owned open state across compatible morphs.
summaryRequiredThe disclosure's visible summary and accessible trigger text.
openfalseWhether the disclosure starts expanded; subsequent open state belongs to the browser.