Text
Disclosure
Published on
Description
The disclosure widget uses native <details> and <summary> elements to show and hide content. Use for simple show/hide interactions such as FAQs, additional context, or collapsible sections.
Do not use <details>/<summary> as a replacement for accordions, tabs, menus, or dialogs — they are disclosure widgets only.
Example
Example (class="chevron")
Accessibility
<summary>has an implicit button role witharia-expandedstate managed by the browser.<summary>neutralizes nested element semantics — a heading inside<summary>will not be announced as a heading.- No JavaScript is required for basic disclosure, but interactive patterns beyond simple show/hide need JavaScript for proper state management.
- CSS-only interactive widgets cannot manage ARIA state and are inaccessible.
References
- Disclosure Widgets (opens in new tab) — Adrian Roselli
- Details / Summary Are Not [insert control here] (opens in new tab) — Adrian Roselli
- CSS-only Widgets Are Inaccessible (opens in new tab) — Adrian Roselli
Related
Variables
None for disclosure