Accordion
A stack of sections that expand and collapse to show or hide their content.
Usage
Accordion stacks collapsible sections — ideal for FAQs, settings groups, and any content you want to keep scannable until it's needed. Compose it from four parts, all under @appica/ui-react/accordion:
Accordion— the root. Owns which items are open (value/defaultValue), whethermultiplecan be open at once, and the sharedvariantandiconstyling.AccordionItem— one section, identified by itsvalue. Can be individuallydisabled.AccordionTrigger— the header button that toggles its panel; renders the open/close icon.AccordionContent— the collapsible panel, which animates its height open and closed.
The variant, icon, iconVariant, and iconPosition props set on the root cascade to every item, and any item or trigger can override them locally.
Examples
Default
By default only one panel is open at a time — opening another closes the last. Set the initially open item(s) with defaultValue.
Variants
Three variants change the surface: default is a filled card, alt is a flat card that gains a border on hover/open, and flush drops the card entirely for a borderless list.
Icons
Switch the indicator with icon="plus" (a plus that morphs to a minus) or hide it with icon={false}. Wrap it in a tile with iconVariant="icon-box", and move it ahead of the label with iconPosition="start".
Open multiple
Set multiple to let any number of panels stay open at once — useful when sections are independent rather than mutually exclusive.
Disabled item
Add disabled to an AccordionItem to lock it shut. It dims, can't be toggled, and is skipped by keyboard navigation.
Leading media
The trigger label is just children, so you can prefix it with any media — a plain icon, a Thumbnail, or an Avatar. They line up with the text while the indicator icon stays pinned to the trailing edge.
Controlled
Drive the open items yourself with value + onValueChange. Here the open panel is read out and stepped through with external prev/next buttons, while clicking a header still updates the same state.
RTL
Every Appica UI component supports right-to-left layouts out of the box. Set the dir attribute on a container (commonly your <html> element) so CSS logical properties resolve correctly, and wrap your tree in DirectionProvider so direction-aware behavior follows the same direction.
The trigger text aligns to the right and the indicator icon moves to the left, all from CSS logical properties. For setup details and caveats, see the RTL guide.
API reference
Accordion wraps Base UI's Accordion. Each part forwards every remaining prop to the matching Base UI primitive, so anything it accepts works here — the tables below list the Appica additions and the most common props. The panel exposes the --accordion-panel-height CSS variable that powers the height animation. See the Base UI docs for the complete API.
Accordion
The root. Renders a <div> and owns the open state and shared styling.
AccordionItem
One section. Renders a <div> and exposes data-open / data-disabled for styling.
AccordionTrigger
The header button. Rendered inside an Accordion.Header; toggles its panel and shows the icon.
AccordionContent
The collapsible panel. Renders a <div> that animates its height between open and closed.
Accessibility
- Each
AccordionTriggeris a real<button>inside a heading, witharia-expandedandaria-controlswired to its panel — assistive tech announces the open/closed state. - Keyboard support follows the WAI-ARIA accordion pattern: Tab moves between triggers, Enter/Space toggles the focused panel, and the arrow keys move focus between headers (wrapping at the ends).
- A
disableditem is removed from the tab order and skipped by arrow navigation, and exposesdata-disabledfor styling. - The indicator icon is decorative (
aria-hidden); the trigger's text label carries the meaning. - The panel's height animation honours
prefers-reduced-motion.