Collapsible List

An expandable inline section on a page to progressively disclose information.

UsageOverview

A collapsible is a container with a header and a content panel that can be expanded and collapsed to reveal more information or actions. Collapsible sections can be grouped to create an accordion or used individually.

Collapsible sections:

When not to use
AnatomyElements

  1. Title.
  2. Collapse/expand icon.
  3. Click target.
  4. Actions.
  5. Content panel
States


VariationsTypes
Desktop Mobile
Designed for larger screens, desktop collapsible sections have the expand icon to the left allowing for quicker recognition and action. Collapsible sections for mobile have a larger tap target and the expand icon is on the right, this prevents the user's view to be obstructed by his/her hand when making selections.


BehaviorTrigger & Dismissal

Clicking on the title expands and collapses the collapsible panel, except when there are additional actions to the right.

Links

When a header title contains additional actions, the click targets are as follows:

Loading

The content of these collapsible containers should always be short and loaded with the document, but if they need to be loaded dynamically, like in a lazy load, a spinner can be added to indicate a response.

Validation & errors

In the case mentioned above where the content of the collapsible panel is loaded dynamically, there may be a case where data fails to load. In that case, opt to show the user an error message using a toast notification.

Keyboard navigation
Key Function
Enter When focus is on a header of a collapsed section, expands the section
Tab Moves focus to the next focusable element.All focusable elements in the collapsible panel are included on the page Tab sequence.
Shift + Tab Moves focus to the previous focusable element.All focusable elements in the collapsible panel are included on the page Tab sequence.
Down arrow When focus is on a header, moves focus to the next header.When focus is on the last header, moves focus to the first header.
Up arrow When focus is on a header, moves focus to the previous accordion header.When focus is on the first header, moves focus to the last accordion header.

Order & AlignmentGrouping

Grouping many collapsible sections together can create an accordion. It is not recommended to use an accordion that only allows 1 section to be open at a time.

Hierarchy

Collapsible sections grouped into an accordion are more acceptable when individuals on a single page require just a few main pieces of content. Users may spend their time more easily focusing on the few topics that matter by hiding most of the content. For this reason, plan your IA so your page is scannable and the most relevant information is presented first.

Position
OverflowTruncate

Header titles should be short and scannable. Avoid long titles. Instead of truncating, use word wrapping.

Scrolling

Scrolling within a collapsible panel should be considered carefully. If the information displayed in the panel is too long, consider offering a quick summary and a link to another page, or using tabs instead.

On mobile devices, however scrolling may be necessary to view all the data in an expanded panel, in this case, in a group of collapsible sections, consider making the group sticky so the user can easily collapse the panel without getting lost in the page.


Best PracticesAccessibility Responsiveness

Collapsible sections are a good way of compressing information and making a page quicker to read and understand. In mobile devices, they work especially well to that effect on the reduced viewport. Always include the mobile variation of the component to ensure proper usability. On longer viewports, consider transforming a collapsible element group (accordion) into tabs.


Feedback

We would like to get your feedback. Tell us how you use this component in your projects and how we can improve it.

Style

HTML/CSSCollapsible (v2)