An expand/collapse widget lets you reveal additional information on demand. This example uses the native HTML details/summary elements.
This section is open by default using the "open" attribute. Remove it to start collapsed.
Using the open attribute:
<details class="details" open>...</details>
You can also control a details widget with JavaScript. Use the button below to toggle this section.
This parent section contains another expand/collapse widget nested inside. Each widget is independently controllable.
Nested widget follows the same pattern and is wrapped with its own "example" container.
Nested content lives here. It can be expanded and collapsed separately from the parent section.