Accordion

A group of native disclosures with shared or independent expansion.

A shared name keeps one item open where the browser supports it; older browsers expand independently.

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 accordion

Usage

html
{% import "suprnova-ui/accordion/accordion.html" as accordion %}
{% call accordion::accordion("faq") %}{% call accordion::accordion_item("faq", "installation", "How do I install it?") %}<p>Run suprnova live:add accordion.</p>{% endcall %}{% endcall %}

Examples

Independent items

Distinct names let several items stay open without a server request.

Open in new tab

Keyboard and accessibility

suprnova.accordion - a group of native disclosures. Items share the group's name so the browser keeps one open at a time where details name is supported (Chrome 120, Firefox 130, Safari 17.2); older supported browsers open items independently. Each item is keyed and preserved like a collapsible (OVL-001, OVL-006).

API reference

accordion

ParameterDefaultDescription
nameRequiredThe group name, shared by single-open items through their native `name` attribute.

accordion_item

ParameterDefaultDescription
nameRequiredThe item's native disclosure name; share a name for single-open items, use distinct names for independent expansion.
keyRequiredA stable `live:key` that preserves this item's browser-owned open state across compatible morphs.
summaryRequiredThe disclosure's visible summary and accessible trigger text.
openfalseWhether the item starts expanded; subsequent open state belongs to the browser.