Accordion
Questions that open their answer in place. Height animates with the village's motion, and not at all under reduced motion.
Yes. It reads only the village tokens, so the same accordion follows Konoha, Kiri or Iwa.
Installation
Or with the shadcn CLI, from the registry:
Usage
Several open
One item is open at a time. Pass multiple to let several stay open; the value is an array either way.
Variants
default splits the items with a rule. outline puts them inside one bordered block; separated makes each item its
own card, for a FAQ on a page.
A whole design language, switched at runtime.
A whole design language, switched at runtime.
Villages
Rules between items in the village's border, headings in its type; Iwa sets the questions in capitals.
Yes. It reads only the village tokens, so the same accordion follows Konoha, Kiri or Iwa.
Yes. It reads only the village tokens, so the same accordion follows Konoha, Kiri or Iwa.
Yes. It reads only the village tokens, so the same accordion follows Konoha, Kiri or Iwa.
Yes. It reads only the village tokens, so the same accordion follows Konoha, Kiri or Iwa.
Yes. It reads only the village tokens, so the same accordion follows Konoha, Kiri or Iwa.
Yes. It reads only the village tokens, so the same accordion follows Konoha, Kiri or Iwa.
Accessibility
- Each trigger is a button inside a heading, with
aria-expandedandaria-controls; each panel is aregionnamed by its trigger. - Enter or Space toggles; arrow keys, Home and End move between triggers.
API reference
The parts of Base UI's Accordion, styled:
| Part | Notes |
|---|---|
Accordion | value, defaultValue, onValueChange, multiple, disabled; variant ("default" | "outline" | "separated") for its items |
AccordionItem | value, disabled |
AccordionTrigger | the heading's button, with its chevron |
AccordionContent | the panel; keepMounted, hiddenUntilFound |