Disclosure
A summary that shows or hides more content, built on <details> and <summary>.
Live example
Disclosure
<details>
<summary>What is included in the plan?</summary>
<p>Unlimited projects, five collaborators and email support.</p>
</details>
Exclusive accordion
<div data-disclosure="accordion">
<details name="faq" open>
<summary>Shipping</summary>
<p>Orders ship within two working days.</p>
</details>
<details name="faq">
<summary>Returns</summary>
<p>Return unused items within 30 days for a full refund.</p>
</details>
<details name="faq">
<summary>Warranty</summary>
<p>Every product has a two-year warranty.</p>
</details>
</div>
Accordion with several open
<div data-disclosure="accordion">
<details>
<summary>Monthly plan</summary>
<p>Pay each month and cancel any time.</p>
</details>
<details>
<summary>Yearly plan</summary>
<p>Pay once a year and get two months free.</p>
</details>
</div>
Inline show more
<p>The release adds pagination, tabs and toasts.</p>
<details data-disclosure="plain">
<summary>Show the full list of changes</summary>
<ul>
<li>Twelve molecules with example pages.</li>
<li>Five small web components.</li>
<li>Four explainers for custom patterns.</li>
</ul>
</details>
Attributes
| Attribute or value | Where | Effect |
|---|---|---|
data-disclosure="accordion" | a wrapper around several <details> | joins them into one bordered block |
data-disclosure="plain" | a <details> | no box, for "Show more" text inside prose |
name="group" | each <details> (native) | only one open |
open | a <details> (native) | open on load |
Keyboard
| Key | Action |
|---|---|
| Tab | moves to the next summary / Shift+Tab: previous |
| Enter / Space | opens or closes the focused section |
Accessibility
<summary>is a button witharia-expanded(HTML-AAM), so there is no ARIA to write.- Unlike the APG Accordion, headers are not headings and have no arrow keys. Both are optional there.
- Avoid exclusive groups (
name) when people compare sections.
Specifications
See also
- Molecules
- Source:
css/components/molecules/disclosure.css,examples/molecules/disclosure.html - Demos: Dashboard view (Plain HTML, React, Angular, Astro, Vue, Svelte)
How other systems do it
For comparison only; these are not the standard this system follows.
- Apple Human Interface Guidelines: Disclosure controls
- Material Design 3: No equivalent
- Vercel Geist: Collapse