Accordion
A stack of headings that each show or hide a section of content.
Preview
An itemised invoice, the prescription or referral, and a discharge summary for hospital stays.
Installation
npm
Manual
pnpm add @syntara/react @syntara/tokensimport { Accordion, AccordionItem } from '@syntara/react';Usage
import { Accordion, AccordionItem } from '@syntara/react';
export function ClaimFaq() {
return (
<Accordion defaultExpandedKeys={['documents']}>
<AccordionItem id="documents" title="Which documents do I need?">
An itemised invoice and the prescription.
</AccordionItem>
<AccordionItem id="timeline" title="How long does a review take?">
Most claims are reviewed within 3 working days.
</AccordionItem>
</Accordion>
);
}Examples
FAQ, several open
allowsMultipleExpanded, a custom heading level and a disabled item.
Yes. The new plan starts on the first day of next month and we adjust the premium from then.
Emergency treatment is covered for trips up to 30 days. Planned treatment abroad needs pre-approval.
Accessibility
| Keys | Action |
|---|---|
| TaborShiftTab | Moves between triggers and into open content. |
| EnterorSpace | Opens or closes the focused item. |
- Each trigger is a button with aria-expanded and aria-controls inside a heading (level 3 by default).
- Panels are role="group" labelled by their trigger. Closed panels use hidden="until-found", so find-in-page can open them.
- The chevron rotates as a secondary cue; aria-expanded carries the state.
- Height animates only with prefers-reduced-motion: no-preference.
Guidelines
Do
- Use for optional detail people scan by heading, like FAQs or settings groups.
- Write titles as the question or topic people look for.
- Open the most useful item by default when there is one.
Don’t
- Don't hide content everyone needs — show it.
- Don't put a whole page's main flow inside an accordion.
- Don't nest accordions.
API reference
Accordion
allowsMultipleExpandedbooleanLets more than one item be open at once.
Default
falseexpandedKeysIterable<Key>Ids of open items (controlled).
defaultExpandedKeysIterable<Key>Ids of items open at first (uncontrolled).
onExpandedChange(keys: Set<Key>) => voidCalled with the ids of open items when they change.
isDisabledbooleanDisables every item.
Default
false
AccordionItem
idRequiredKeyUsed by expandedKeys and onExpandedChange.
titleRequiredReactNodeText of the trigger button.
childrenReactNodeThe content shown when open.
headingLevel2 | 3 | 4 | 5 | 6Heading level wrapping the trigger; match the page outline.
Default
3isDisabledbooleanPrevents opening or closing this item.
Default
false
Tokens
The semantic tokens this component reads, grouped by what they control. Swatches show this site’s theme; change a tenant’s brand and the component follows with no code change.
- Colour5
border.subtletext.defaultfocus.ringtext.disabledtext.subtle- Type4
font.size.mdfont.weight.mediumline-height.snugline-height.normal- Space and size5
space.4control-heightspace.1space.6space.3- Shape2
radius.badgeradius.pill- Motion7
motion.duration.fastmotion.easingmotion.duration.slowmotion.easing-outmotion.duration.normalmotion.duration.springmotion.spring