Accordion

Accordions are most often used for hiding and showing sections of related content.

Overview

Accordions can have different selection modes, where users can have multiple or single Accordion Item(s) open.

Usage

  • To organize related text-based information.
  • To shorten pages and reduce scrolling when content is not crucial to read in full.

Sample

Best practices

While similar to a Block, Accordions are not intended to be used within within a Panel.

Accordion is best suited to containing narrative or text-heavy content in the main interactive area of an application, whereas Block is recommended for displaying interactive controls and elements within a Panel.

Do use Accordion to contain related but distinct, primarily text-based content.
Do use Accordion within the main content area of an application to save space.
Avoid using Accordion within a Panel. Instead, use one or more Block(s).
Avoid using Accordion to house interactive controls or form-based components.

Try to avoid placing interactive controls or elements that affect an application state or display within Accordion. These should instead be placed within one or more Block(s). However, in certain instances, it may be appropriate to place interactive controls or form-based elements inside an Accordion - for example, when located within the main content area of a Settings page.

Accessibility

Keyboard navigation

KeyFunction
TabMoves focus to next non-disabled calcite-accordion-item. If the currently focused step is the last step, the focus will leave the component.
Tab and ShiftMoves focus to previous non-disabled calcite-accordion-item. If the currently focused step is the first step, the focus will leave the component.
EnterToggles the expansion of the selected calcite-accordion-item.
SpaceToggles the expansion of the selected calcite-accordion-item.

API reference

Properties

Slots

Styles

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.