Skip to main content

Accordion

Collapsible content panels using the native HTML <details> / <summary> elements, styled automatically by @primus/ui-core. No JavaScript required โ€” the browser handles open/close natively.

Preview ยท Accordion

Codeโ€‹

<!-- Basic accordion item -->
<details>
<summary>What is multi-tenancy?</summary>
<p>Multi-tenancy allows a single application to serve multiple customers...</p>
</details>

<!-- Open by default -->
<details open>
<summary>How is data isolated?</summary>
<p>Each tenant's data is isolated via row-level security...</p>
</details>

<!-- Grouped accordion (use CSS to connect borders) -->
<div style="border:1px solid var(--border);border-radius:8px;overflow:hidden">
<details style="border-bottom:1px solid var(--border)">
<summary style="padding:1rem 1.25rem">Question one</summary>
<div style="padding:0 1.25rem 1rem">Answer one</div>
</details>
<details style="border-bottom:1px solid var(--border)">
<summary style="padding:1rem 1.25rem">Question two</summary>
<div style="padding:0 1.25rem 1rem">Answer two</div>
</details>
<details>
<summary style="padding:1rem 1.25rem">Question three</summary>
<div style="padding:0 1.25rem 1rem">Answer three</div>
</details>
</div>

Propsโ€‹

<details> and <summary> are native HTML elements โ€” no custom props. @primus/ui-core styles them automatically.

AttributeElementDescription
open<details>Boolean โ€” panel is open by default
No attributes needed<summary>Styled automatically โ€” click to toggle
Version history

See the Changelog for version history and breaking changes.