An expand/collapse widget shows or hides additional information when activated. This example uses the built-in HTML <details> element paired with a <summary> trigger.
- Click the summary to toggle visibility.
- Works without JavaScript.
- Provides accessible semantics by default.
<details class="details">
<summary>Title</summary>
<p>Hidden content.</p>
</details>