Accordion

Accordions contain long sections of information under a block that can be expanded or collapsed

Healthy
Show details
Healthy
Published: November 28, 2022
Updated: January 22, 2024

Design

 

Types

  • Default: the default accordion, a container that can be clicked to expand content within
Default accordion, collapsed

 

  • Error accordion (being phased out): a condensed alternative to the Error Banner that's used exclusively in the campaign, template, and experiment editor sub-nav to inform marketers there are errors in the content or configuration of the resource.

    This component will be phased out in a future update of the Editor in favor of the Error Banner.
Error accordion, collapsed

Error accordion, collapsed

Error accordion, expanded

Error accordion, expanded

Structure

Accordions consist of

  • Title - The title can contain text or images that describe the grouping contained within the content block

 

  • Trigger - The trigger will often float to the right of the container. It will be an icon button containing either a chevron down (expanded) or a chevron right (collapsed)

 

  • Content - Content block that is shown when the accordion is expanded.

 

Note that multiple accordion items can be expanded at one time.

 

States

  • Collapsed: shows the container title and condenses the container size; can be expanded by clicking the the container
  • Expanded: shows the container title and expanded content block; can be collapsed by clicking the the Title row of the container (the same are that was clicked to expand it)
Collapsed

Collapsed

Expanded

Expanded

Guidelines

 

  • Indicate in your design file whether the accordion should be expanded or collapsed by default based on user needs and content relevance
  • Ensure that the chevron-right rotates 90° and faces downward when the content is expanded, and animates back to it's initial state when collapsed
  • Use smooth animations for expanding and collapsing, but keep them quick to avoid user frustration
  • Don't hide critical or commonly-edited information inside of an accordion or collapsed content
  • Avoid nested accordions. They can make navigation and understanding content structure more complex

Content

  • Don't overload each panel with too much content. Accordions are best for concise, digestible sections of information—two to three sentences of content is a good rule of thumb if the accordion content is text only
  • Ensure that the content within each accordion panel is grouped logically. Use accordions for independent sections of content that can be expanded or collapsed.

Accessibility

  • Make sure the accordion is accessible, including keyboard navigation and screen reader support
  • Use appropriate ARIA attributes

Health

Is documented

The component is fully documented

Accessibile

Tested against WCAG 2.1 AAA accessibility guidelines

Tokens

This component uses tokens in both Figma and code

Figma component

Includes a link to a Figma component that has been imported to Supernova

Storybook

Includes a link to an external code repository

Status

The component has a health status indicated

Healthy