An expand/collapse widget—also known as a disclosure widget—reveals additional information when requested by the user. The native <details> element automatically handles keyboard and mouse interaction, and browsers map it to the correct accessibility roles.
- Keyboard toggle via Space or Enter
- Accessible name taken from the
<summary> - No extra JavaScript required