Details
<gcds-details>
Also called: accordion, collapse.
Details is an interactive switch for a person to expand or collapse content.
-
GitHub -
Figma
Details component preview
Take a look at what problems the details component solves to see if they fit the problem you're solving for.
Problems details solve
Use the details component to give a person a summary of more detailed content you've hidden that they can choose to reveal. Use this component to:
- Reduce page size and scrolling when the content is lengthy and not essential to read in full. For example in an address collection pattern, the shipping address may be hidden using a details when it's the same as the mailing or billing address.
- Give a summary of content that is secondary to the main task and may be overwhelming to some readers.
- Make a page with many subheadings scanable. For example, in a series of questions and answers, you can list the questions as details titles and a person can expand any section to read the answer content.
- Give readers the option to control content for subjects that may cause distress to some readers. They can access certain content when they are ready and hide content once they've reviewed it.
Related components
Tabs when you want to replace the entire content of a section or a page.
Links to provide navigation to a new page, website, or section on the current page or files for download.
Buttons when a person modifies data, changes a state, or initiates a specific action.
Help us improve
Have questions or a request? Give feedback on our contact form.
Something's wrong? Raise it through GitHub with an