Accordion

Also called collapsible sections or expandable FAQ

A vertical stack of headings that each expand to reveal their content when clicked, so long pages stay short and easy to scan.

What is Accordion?

An accordion shows a list of headings, such as FAQ questions, with the details hidden. Clicking a heading slides its section open, and a chevron rotates to show the state. Some accordions close the open section when you open another; others let several stay open.

Use accordions for FAQs, groups of settings, and long reference content where people need only one or two sections. Content that most people need to read should stay visible, since hiding it costs a click. Make each heading a real button with aria-expanded.

Animate the height so content does not jump, over about 200 to 300ms with an ease-out curve. The native <details> element opens and closes with no script, giving several of them the same name lets only one stay open, and interpolate-size: allow-keywords lets CSS animate to height: auto in Chromium browsers.

Often confused with

Tabs
Tabs show one panel at a time in the same spot. An accordion stacks sections vertically and can open more than one.
All terms

Height auto animation

An animation that opens or closes a panel to the exact height of its content, even though that height is unknown ahead of time.

Tabs

A row of labels that switches between panels of related content in the same spot, showing one panel at a time.

Layout animation

An animation that smoothly moves and resizes elements when the layout changes, such as list items gliding to new spots after a sort or filter.

Reduced motion

An operating system setting that asks apps to minimize movement, which websites detect with the prefers-reduced-motion media query.