GC Design SystemComponents
GC Design System Start to use Page templates overviewBasic page Components overviewAlertBreadcrumbsButtonCardCheckboxesContainerDate inputDate modifiedDetailsError messageError summaryFieldsetFile uploaderFooterGridHeaderHeadingIconInputLanguage toggleLinkNoticePaginationRadiosScreenreader-onlySearchSelectSide navigationSignatureStepperTableTextTextareaTheme and topic menuTop navigation CSS Shortcuts overview Reset styles Responsive layoutState Box sizingContainer sizingDisplayOverflowPositionVisibility FontFont familyFont sizeFont styleFont weightLine heightLink colourLink sizeLink text decorationList styleText alignText colourText overflowText transformWord break MarginPadding Align contentAlign itemsAlign selfFlexFlex directionFlex growFlex shrinkFlex wrapGapGrid columnsGrid rowsJustify contentJustify itemsJustify selfOrderPlace contentPlace itemsPlace self Background colourBorder colourBorder radiusBorder styleBorder width Icon namesIcon sizeImage CursorPointer eventsTransition Styles overviewDesign tokensColourSpacingTypography Contact usGet InvolvedFind a demo

Details
<gcds-details>

Also called: accordion, collapse. Details is an interactive switch for a person to expand or collapse content.

Details component preview

On this page

Coding and accessibility for details

Present the details component to support understanding

The details component can add to a person’s cognitive load when it:
  1. Interrupts the flow of reading or scrolling.
  2. The content they need is difficult to find and search.
  3. They are unfamiliar with the expand and collapse function.
To help a reader’s experience accessing details content:
  • Use the open attribute to define if the details content is open by default or not.
  • Make details titles clearly state what the content’s about. Avoid non-descriptive titles such as “Read more”. Instead, opt for a specific and descriptive summary, like “Maximum coverage amount for your physio benefit”.
  • Make titles distinct so people know the difference. Identical or similar titles can be confused.
  • Avoid placing one details component inside another, where no one would know to look for that content.
  • Make details content searchable.

Examples

Explore the different ways you can configure the component. Each example shows a working implementation and ready-to-copy code.

In this section

Essential attributes

These attributes are needed for the component to function correctly.

details-title

The details-title attribute defines the label that summarizes the details content.
<gcds-details details-title="Learn more about this topic">
<gcds-text margin-bottom="0">Additional information.</gcds-text>
</gcds-details>

Optional attributes

These attributes allow you to customize or extend the component’s behaviour and presentation.

open

The open attribute controls whether the details component is open by default or not.
<gcds-details details-title="Learn more about this topic" open>
<gcds-text margin-bottom="0">Additional information.</gcds-text>
</gcds-details>

Slots

The default slot allows you to inject custom content into the component’s primary content area, and named slots, into specific areas.

default

The default slot is for adding content inside the details component.
<gcds-details details-title="Learn more about this topic">
<gcds-text margin-bottom="0">Additional information.</gcds-text>
</gcds-details>
Code builder Generate an instance of the component you need by selecting its code properties.
  • Explore by choosing different code values to generate the instance you want.
  • Get the code and pull it into your environment.
  • Add any copy you need to the component (like text for a label).
Note: The code builder uses English for all code elements, which follows standard practice. Additional information.
Help us improve Have questions or a request? Give feedback on our contact form. Something's wrong? Raise it through GitHub with an account. You'll have access to the team's direct responses, progress made on your issue, and issues raised by others. Give feedback Report an issue on GitHub
2026-05-20