An expand/collapse widget allows users to toggle the visibility of additional information.
- Click the summary to reveal hidden content.
- Click again to collapse it.
- The container for the controlled content has the class
details.
Each widget is wrapped in a container with the class example. The controlled content container uses the class details.
A simple widget using a summary to show or hide content.
An expand/collapse widget allows users to toggle the visibility of additional information.
details.This widget starts expanded using the open state.
This section is open by default. The open state can be toggled by clicking the summary.
Use this pattern when content is likely to be relevant right away.
Opening one section will close the others within this widget.
This section provides an overview of the accordion pattern. It keeps interfaces tidy by showing one pane at a time.
Accordions are helpful for lengthy content. They reduce scrolling by segmenting information into manageable parts.
Use buttons to open or close sections programmatically.
This section can be toggled with the "Toggle first" button above, or by clicking its summary.
This section is affected by the Expand all and Collapse all controls. Try them to change both sections at once.