Skip to content

Accordion

Edit on GitHub
@volvo-cars/css v2.3.0@volvo-cars/react-accordion v2.3.20

The accordion component is used to toggle the visibility of additional content.

Accordion anatomy

  1. Label
  2. Stroke
  3. Chevron

The accordion component is used to toggle the visibility of additional content, allowing users to reveal or hide sections as needed.

Accordions can be utilized in various contexts, such as FAQs, product descriptions, or any scenario where content needs to be organized in a compact, expandable format.

Example: Accordions used in FAQs

Example: Accordions used in FAQs.

Showing accordion in medium text style

Showing accordion in medium text style.

Showing accordion in semi light text style

Showing accordion in semi light text style.

Showing accordion collapsed

Showing accordion collapsed.

Showing accordion expanded

Showing accordion expanded. Content inside is added separately.

Showing accordion in 20pt in semi light and medium font

Showing accordion in 20pt in semi light and medium font.

Showing accordion in 16pt in semi light and medium font

Showing accordion in 16pt in semi light and medium font.

Showing accordions in light mode

Showing accordions in light mode.

Showing accordions in dark mode

Showing accordions in dark mode.

Showing chevron on the right side

Showing chevron on the right side.

Showing chevron on the left side

Showing chevron on the left side. This can be used when using wider sections.

Accordion with 20px text uses minimum 60px target size

Accordion with 20px text uses minimum 60px target size.

Accordion with 16px text uses minimum 56px target size

Accordion with 16px text uses minimum 56px target size.

Spacing inside accordions depends on component.

Spacing setup 1 with 48 spacer

In this setup we want a bit more spacing inside the accordions since we have used clickable buttons. Here we use 48 spacer between content to ease up the tap area. Stroke and margin is added manually to the content inside.

Spacing setup 2 with 32/24 spacers

In this setup we want less spacing so here we use 32 spacer between content and 24 spacer after text inside an accordion. Stroke and margin is added manually to the content inside.

Example: Accordions used as a product listing component

Example: Accordions used as a product listing component.

Example: Accordions used in a FAQ component

Example: Accordions used in a FAQ component.

Example: Accordions used as a nested option

Example: Accordions used as a nested option.

Generally you can leave the state of the accordion up to the user, to collapse and expand each item. If you have limited vertical space you can create an exclusive accordion that only allows one item to be open at a time.

Showing one item open

Showing one item open.

When using this option you can have all items open when toggled at the same time.

This is our recommended option.

Showing 2 items open at the same time

Showing 2 items open at the same time.

Accordions hide content, which isn’t necessarily a good thing. Hiding content diminishes people’s awareness of it and to click on each heading to show information can be cumbersome and exhaust the user in finding what they need.

Accordions are suitable when people need only a few key pieces of content on a single page. By hiding most of the content, users can spend their time more efficiently focused on the few topics that matter.

Accordions should be avoided when the audience needs most or all of the content to answer their questions or solve their problem. In those cases it’s better to show all the content at once.

Make sure to provide clear and concise labels for the accordion headers to indicate the content they toggle.

If you nest accordions, make sure there is a clear hierarchy between the different levels of nesting.

Nesting example - Do

Do

Nesting example - Don't

Don’t

The chevron icon signifies additional content and indicates an accordion item’s interaction. The chevron can be either at the start or the end of the header. Be consistent with the icon placement within an experience.

Layout example - consistent chevron placement

Use accordions with consistent chevron placement in the same layout.

Layout example - inconsistent chevron placement

Avoid using accordions with inconsistent chevron placement.

Layout example - without chevrons

Avoid using accordions without chevrons.

Figma - Web Core Library

Storybook - Accordion

Used to display information sequentially.

Stepped accordion anatomy

A stepped accordion is used to display information sequentially. Stepped accordions can be used when displaying information that otherwise would be too overwhelming when displayed at once.

Stepped accordion on small breakpoint

Displaying Stepped accordion on sm breakpoint.

Stepped accordion on large breakpoint

Displaying Stepped accordion on lg breakpoint.

Stepped accordion comes in two heading sizes. 20pt and 16pt. Both variants uses the same spacing and description size.

20pt stepped accordion

Displaying stepped accordion with 20pt heading and 16pt description.

16pt stepped accordion

Displaying stepped accordion with 16pt heading and 16pt description.

A stepped accordion always has one active selection. When selected, it shows a highlight border, and the content becomes visible.

Selected state

Displaying selected state.

In the unselected state, there is no selected border or visible content. Instead, the heading becomes a clickable element to allow the user to select the collapsed step.

Unselected state

Displaying unselected state.

The Default state represents when the tab is inactive but available for interaction.

Default state

Displaying stepped accordion in its default state.

The Hover state appears when users move their cursor over the link on non-touch devices.

Hover state

Displaying the stepped accordion in its hover state.

The Pressed state communicates a user click, tap, or press. On touch devices, the pressed state is visible only momentarily.

Pressed state

Displaying the stepped accordion in its pressed state.

Light mode

Displaying stepped accordion in light mode.

Dark mode

Displaying stepped accordion in dark mode.

Stepped accordion have a minimum target size of 40px.

20pt touch area

20pt heading is using 44px touch area.

16pt touch area

16pt heading is using 40px touch area.

Spacing between accordions

Stepped accordions uses 8px spacer between each other.

Small breakpoint example

Displaying Stepped accordion on sm breakpoint.

Large breakpoint example

Displaying Stepped accordion on lg breakpoint.

Keep the text short and descriptive. If more text is needed, use a link to another page.

Maximum 2 rows of text on the smallest breakpoint. Use text that describes or relates to the content in the full description.

Limit text to a maximum of 4 rows on the smallest breakpoint.

Do not combine tabs and stepped accordions within the same element.

Do use stepped accordion by itself

Do use stepped accordion by itself.

Don't use tabs and stepped accordion together

Don’t use tabs and stepped accordion at the same time.

When combining images and text, make sure the image height exceeds the text height.

Do use larger image than the text element

Do use larger image than the text element.

Don't use smaller image than the text element

Don’t use smaller image than the text element.

You may use stepped accordions on sm and md breakpoints while using tab buttons on lg and xl breakpoints.

Stepped accordion transitioning to tabs

Displaying Stepped accordion on sm breakpoint that transitions into a tab button on lg breakpoint.