Skip to content

Accordion

The accordion component allows users to expand and collapse content sections in a vertically stacked layout. Each section is represented by a header that users can select to reveal or hide the corresponding content.

Usage

Accordions are often used to display large amounts of related information in a condensed, organized manner. By collapsing and expanding sections, users can focus on the selected content.

The title in the header gives a preview of the content, allowing to find the looked after information quickly and efficiently. For sections containing lists or data, a badge can offer a quick summary, such as the total number of items.

Accordion

When to use

  • When users need to focus on key information without viewing all content at once.
  • To group related information clearly and in a way that's easy to navigate, improving content understanding.
  • When space is limited, allowing users to hide irrelevant content, especially in side panel or on mobile screens.
  • Use it for content that is not immediately necessary but still useful for users to access when they need it.

Best practices for accordions

  • Don't use it when users need most or all of the content on the page to accomplish their task.
  • Keep the number of sections manageable to avoid clutter.
  • Consider expanding important sections by default.
  • Avoid using them for primary navigation or essential information.

Except where otherwise noted, content on this site is licensed under MIT License.