Accordion

Accordion groups a collection of contents in tabs.

Accordion is defined using AccordionPanel, AccordionHeader and AccordionContent components. Each AccordionPanel must contain a unique value property to specify the active item.

Header I

Accordion is defined using AccordionPanel, AccordionHeader and AccordionContent components. Each AccordionPanel must contain a unique value property to specify the active item.

Header I
basic-demo

AccordionPanel can be generated dynamically using the standard @for block.

dynamic-demo

Only one tab at a time can be active by default, enabling multiple property changes this behavior to allow multiple tabs. In this case activeIndex needs to be an array.

Header I
multiple-demo

Enabling disabled property of an AccordionTab prevents user interaction.

Header I
disabled-demo

Panels can be controlled programmatically using value property as a model.

Header I
controlled-demo

Accordion is customized with toggleicon template.

Amy Elsner3
template-demo

Screen Reader

Accordion header elements have a button role and use aria-controls to define the id of the content section along with aria-expanded for the visibility state. The value to read a header element defaults to the value of the header property and can be customized by defining an aria-label or aria-labelledby property. Each header has a heading role, for which the level is customized by headerAriaLevel and has a default level of 2 as per W3C specifications.

Disabled accordions headers use aria-disabled and are excluded from the keybord navigation.

The content uses region role, defines an id that matches the aria-controls of the header and aria-labelledby referring to the id of the header.

Header Keyboard Support

KeyFunction
tabMoves focus to the next the focusable element in the page tab sequence.
shift + tabMoves focus to the previous the focusable element in the page tab sequence.
enterToggles the visibility of the content.
spaceToggles the visibility of the content.
down arrowMoves focus to the next header.
up arrowMoves focus to the previous header.
homeMoves focus to the first header.
endMoves focus to the last header.
ON THIS PAGE
Figma UI Kit
The official Figma UI Kit for Prime UI libraries, the essential resource for designing with PrimeOne components.
Learn More