Accordion
A Base UI Accordion for long reference content scanned by heading: ruled rows, each a heading that opens its panel in place.
import { Accordion, AccordionItem } from '@fairgarden/design/disclosure/accordion'
The glyph is the disclosure glyph: two thin arrows that point outward while collapsed and inward while expanded, muted then in the text ink. It swaps direction and never rotates; chevrons are kept for popups. Several items may be open at once. Panels open with a clip reveal, instantly under reduced motion, and stay in the DOM so find-in-page reaches them and print shows every panel expanded. Never hide content a task depends on, and never convert an accordion into tabs.
Glyphs and the strong top
Glyphs and the strong top
glyph="disclosure" is the default. headed draws a --border-size-2 rule above the first item when the accordion follows a heading. glyph="plusminus" is the documented alternate for product UI; never mix the two on one page. A disabled item mutes its title and glyph, but prefer removing it.
Open dawn to dusk every day. Boardwalks close after heavy frost.
Twelve spaces at the north lot; the 42 bus stops at the gate.
Unavailable while the page is updated.
Trail notes
Flat and accessible, with benches every quarter mile.
Steep switchbacks; muddy in spring.
The plus/minus circle is the alternate for product UI.
Never mix it with the disclosure glyph on one page.
Primary scale
Primary scale
primary drives every part. The expanded glyph is the text ink, not an accent, so secondary is unused.
Rules, titles, glyph and panel text re-resolve together.
The collapsed glyph is the muted step of the same scale.
The strong top rule is the text step of the scale.
On grounds
On paper and forest
paper
Arrows point inward.
Arrows point outward.
forest
Arrows point inward.
Arrows point outward.
API Reference
Accordion
A set of disclosure rows divided by --role-rule rules, including after
the last item. Several items may be open at once (multiple, default
true). Closed panels stay in the DOM (hiddenUntilFound, default
true), so find-in-page reaches them and every panel prints expanded.
Never convert an accordion into tabs.
| Prop | Type | Description |
|---|---|---|
glyph | |
|
headed | | Draws a |
primary | | Primary Radix scale: rules, titles, glyph and panel text. Never defaulted; omitted, it inherits the scope [D133]. |
secondary | | Secondary Radix scale, accepted for the shared contract; no part uses it. |
AccordionItem
One row: a heading wrapping the trigger (optional icon, title, glyph at the row’s end, top-aligned to the title’s first line) and the panel. The whole row is the target. There is no fill change when it opens.
| Prop | Type | Description |
|---|---|---|
headingLevel | | The heading level wrapping the trigger. Default |
icon | | An optional leading subject symbol (§6.10), Material Symbols Rounded at the tag tier; the panel indents to the title column. Dropped below 360 px so the title keeps its width. |
panelProps | | Props for the panel, such as |
title | | The row’s title, |
Additional types
AccordionGlyph
type AccordionGlyph = 'disclosure' | 'plusminus'<'disclosure' | 'plusminus' | null | undefined>AccordionItemProps
Props for AccordionItem: Base UI Accordion Item props (without title) plus the row content.
type AccordionItemProps = {
/**
* The row's title, `type-subhead` in `--primary12`. Write it to stand
* alone: it becomes the printed heading.
*/
title: React.ReactNode;
/**
* An optional leading subject symbol (§6.10), Material Symbols Rounded at
* the tag tier; the panel indents to the title column. Dropped below
* 360 px so the title keeps its width.
*/
icon?:
| 'link'
| 'menu'
| 'search'
| 'circle'
| 'arrow_forward'
| 'arrow_upward'
| 'expand_more'
| 'close'
| 'remove'
| 'add'
| 'check'
| 'chevron_right'
| 'chevron_left'
| 'more_horiz'
| 'more_vert'
| 'play_arrow'
| 'pause'
| 'download'
| 'zoom_in'
| 'zoom_out'
| 'recenter'
| 'help'
| 'mail'
| 'content_copy'
| 'open_in_new'
| 'restart_alt'
| 'description'
| 'widgets'
| 'deployed_code'
| 'format_h2'
| 'format_h3';
/** The heading level wrapping the trigger. Default `3`. */
headingLevel?: HeadingLevel;
/** Props for the panel, such as `keepMounted`. */
panelProps?: Omit<AccordionPanelProps, 'children'>;
}AccordionProps
Props for Accordion: Base UI Accordion Root props plus the glyph, headed and color axes.
type AccordionProps<Value = unknown> = AccordionRoot.Props<Value> & {
glyph?: 'disclosure' | 'plusminus' | null;
headed?: boolean | null;
primary?:
| 'olive'
| 'sage'
| 'slate'
| 'sand'
| 'gray'
| 'mauve'
| 'brown'
| 'bronze'
| 'gold'
| 'red'
| 'ruby'
| 'crimson'
| 'tomato'
| 'pink'
| 'plum'
| 'indigo'
| 'iris'
| 'violet'
| 'purple'
| null;
secondary?:
| 'olive'
| 'sage'
| 'slate'
| 'sand'
| 'gray'
| 'mauve'
| 'brown'
| 'bronze'
| 'gold'
| 'red'
| 'ruby'
| 'crimson'
| 'tomato'
| 'pink'
| 'plum'
| 'indigo'
| 'iris'
| 'violet'
| 'purple'
| 'amber'
| 'blue'
| 'cyan'
| 'grass'
| 'green'
| 'jade'
| 'lime'
| 'mint'
| 'orange'
| 'sky'
| 'teal'
| 'yellow'
| null;
}Specification: DESIGN-SYSTEM.md §10.13 (accordion and collapsible).