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.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "separated" | "joined" | 'separated' | separated cards (default) or one card with dividers. |
AccordionItem props
One expandable section. Works alone too (a single disclosure).
| Prop | Type | Default | Description |
|---|---|---|---|
titlerequired | ReactNode | - | The always-visible header. |
headingLevel | 2 | 3 | 4 | 5 | 6 | 3 | Heading level for the header button. Default 3. |
Accessibility
- Each header is a heading with a button that says if it is expanded.
Keyboard
| Key | Does |
|---|---|
| Enter or Space | Expands or collapses |
Do and don't
Do
- Use questions as titles in an FAQ.
Don't
- Don't hide what most people need.