Skip to content
Alea0.1

Navigation

Accordion

Sections that expand and collapse: FAQs, settings groups, long details.

Ant Design: Collapse

import { Accordion, AccordionItem } from '@alea/ui';

Examples

FAQ

Separated cards, one open at a time.

Yes. Where Figma allows one mode per collection, the plugins fall back to groups.

Joined, several open

One card with dividers; allowsMultipleExpanded keeps several open.

Props

Accordion props

A list of sections that expand and collapse. allowsMultipleExpanded keeps several open.

PropTypeDefaultDescription
variant"separated" | "joined"'separated'separated cards (default) or one card with dividers.

AccordionItem props

One expandable section. Works alone too (a single disclosure).

PropTypeDefaultDescription
titlerequiredReactNode-The always-visible header.
headingLevel2 | 3 | 4 | 5 | 63Heading level for the header button. Default 3.

Accessibility

  • Each header is a heading with a button that says if it is expanded.

Keyboard

KeyDoes
Enter or SpaceExpands or collapses

Do and don't

Do

  • Use questions as titles in an FAQ.

Don't

  • Don't hide what most people need.
Tested with axe, keyboard and screen reader roles