Accordion

The accordion is a component that displays stacked list items. Each list item can collapse (hide) or expand (show) its content when clicked.

Anatomy

Accordion anatomy
  1. Overline defines where the accordion starts.
  2. Accordion title sets the content of the accordion.
  3. Caret icon enforces the behavior of the accordion. The caret-up icon will be shown in the expanded state; and the caret-down in the collapsed state.
  4. Content slot is dedicated to the content of the accordion. The content could be body text or a list group.
  5. Tertiary button is a CTA related to the content.

Usage

When to Use

Use accordions on content-heavy pages so users can easily find key information that may be needed at a specific time. Accordions can be used for FAQs, accommodation detail, or capabilities.

When Not to Use

Don’t use accordions for complex content, when the user needs to access most of the content at once, or when there is little content on the page. Also, avoid using accordions in cases when the content can’t be divided or when doing so interrupts the reading flow.

Variants

Accordion variant 1
Accordion variant 2
Variation
Purpose
Content
Icon
Sizes

Collapsed

Contains information and keeps it hidden until the user needs to access it.

With icon (caret-down)

titleSmall, bodyMedium

Expanded

Displays the information that the accordion contains.

Body text, list group

With icon (caret-up)

titleSmall, bodyMedium

Container

Spacing

The standard distance between individual accordions in groups is 0px.

Accordion spacing

Behavior

To ensure the accordion is used correctly and fulfills its purpose, only one accordion can be expanded when there are multiple accordions on a page. No more than one accordion should display its content at a time.

Accordion behavior do

Do allow one accordion to be expanded at a time.

Accordion behavior don't

Don’t let more than one accordion be expanded at a time.

Sizing

Sizing affects text size, icon size, and internal padding. The default size is large, and you can use props to make the button smaller or larger. We recommend using the red primary button only in the XL and LG sizes for accessibility. 

Accordion sizing

Motion

There is a simple transition animation between one tab and another.

Grouped Accordions

An accordion container can add standard spacing between a group of accordions.The container can have one, two, or three columns. A group of accordions can be accompanied by a text block in the left slot when there are two or three columns.

Ensure that proper space is given between each accordion and group of accordions when placed next to each other. The vertical distance between accordions will be the same as the gutter of the view-port in which they are displayed.

1 Column: Accordions Only

1 Column: Accordions Only

2 Columns: A Text Block and One Accordion Group

2 Columns: Text Block and one Accordion Group

3 Columns: Text Block and Two Accordion Groups

3 Columns: A Text Block and Two Accordion Groups

Themes

Dark theme accordion
Dark
Accordion mid theme
Mid
Accordion light theme
Light