Expand/Collapse Widgets
Two accessible patterns: a native <details> disclosure and a button-controlled region using aria-expanded and aria-controls.
Example 1: Native disclosure
What information is inside?
This content is controlled by the native <details> element, which provides built-in keyboard and screen reader support.
- Press Enter or Space on the summary to toggle.
- State is conveyed via the
openattribute.
Example 2: Button-controlled region
This region is shown/hidden by a button. The button’s aria-expanded attribute updates to reflect the current state.
Learn more about disclosure patterns at WAI-ARIA Authoring Practices.