Accordion
Stacked sections that expand and collapse.
Staticimport { Accordion } from 'umbra-ui'
Props
Accordion
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | — |
AccordionItem
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | — |
AccordionContent
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | — |
Usage notes
type="single" keeps one item open (add collapsible to allow closing it); type="multiple" lets any number stay open. Each AccordionItem needs a unique value.
Accessibility
- Each trigger is a button inside a heading, with
aria-expandedandaria-controls. - Arrow keys move between triggers; Home and End jump to the first and last.
- The open and close animation is skipped under reduced motion.
Import
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from 'umbra-ui';
import 'umbra-ui/styles.css'; // once, at the root of your app