Accordion
A stack of headers that open and close their own section of content.
01Anatomy
6 parts. Select a number or a name to see what each part does.
01 · Container
Holds the whole group. It can be a box, just lines, or nothing.
- Required
- No
02 · Header
The whole row is the button that opens and closes the section, not only the icon.
- Required
- Yes
- Recommended
- At least 44 px tall: on a phone the row is the target.
03 · Title
Says what is inside. It’s also the button’s accessible name.
- Required
- Yes
- Recommended
- Specific and scannable: “Returns”, “Shipping costs”. People read only the titles.
04 · Chevron
Says the row opens, and turns to show whether it’s open.
- Required
- Yes
- Recommended
- Same side for every row. A plus/minus works too, as long as it’s consistent.
05 · Panel
The content of the section, right under its header.
- Required
- Only in some cases
- When
- Only while the section is open.
- Recommended
- Keep it short. If every panel is long, use separate pages or tabs.
06 · Divider
A line between sections, so it’s clear where one ends.
- Required
- No
Example spacing, measured on this drawing (16 px = 1 em). A common implementation, not a rule: values change from system to system. W and H are width and height, as in Figma: Hug follows the content, Fill takes the space of the parent.
Spacing is measured on the normal view: switch back to Normal to show it.
02Structure
- Accordionauto layoutverticalfillhug
- Accordion Iteminstanceone per sectionExpanded = true
- Headerauto layouthorizontalfillmin H 44padding V 10H 16gap 12
- Titletextfill
- Chevroninstanceturns with Expanded
- Panelauto layoutverticalfillpadding 0 16 14boolean
- Contentslotinstance swap
- Dividerlinefillboolean
- Accordion IteminstanceExpanded = false
| Property | Type | Values |
|---|---|---|
| Expanded | Variant | truefalse |
| State | Variant | DefaultHoverFocusDisabled |
| Style | Variant | ContainedDividedSeparated |
| Title | Text | “Shipping” |
| Content | Instance swap | any block |
Build the Item as its own component with Expanded as a variant, then stack instances: in a prototype, Change to on click opens and closes each one.
03States
Some accordions keep one section open at a time, others let many stay open. Many open is easier when people compare sections.
04Variants
There is no single correct anatomy: names, variants and properties differ from one design system to another. These are common structural models distilled from established design systems and accessibility guidance.
Proven methods for designing interfaces with AI. Every two weeks, in Italian.
Subscribe