Accordion · UI design

On this page 7

An accordion in UI design is a vertically stacked set of headers that each expand to reveal a hidden content panel and collapse to hide it again. The pattern lets users scan a list of section titles and open only the content they need, which keeps long pages compact and manageable, especially on small screens.

Accordions are a common UI component in design systems, frequently used for FAQs, settings pages, filters and product details. Not to be confused with the musical instrument, from which the pattern borrows its name because the panels fold and unfold.

How an accordion component works

An accordion consists of repeated header and panel pairs. Each header is an interactive control, usually showing a title and a disclosure indicator such as a chevron or plus sign. Activating the header toggles its panel between the expanded and collapsed states, and the indicator rotates or changes to reflect the current state.

Under the hood, the pattern relies on progressive disclosure, the principle of showing only what is needed at the moment and deferring the rest. The table below lists the anatomy of a typical accordion item and the role of each part.

PartRoleTypical implementation
HeaderLabels the section and acts as the triggerA button inside a heading element
Disclosure iconSignals the open or closed stateChevron that rotates 90 or 180 degrees
PanelHolds the hidden contentRegion linked to its header
DividerSeparates items visuallyThin border or spacing
ContainerGroups all items as one componentList or wrapper element
Anatomy of an accordion item

The panel opening is often accompanied by a short height animation of about 150 to 300 milliseconds. This motion helps users understand that content has been inserted in place rather than loaded on a new page, but it should respect the user’s reduced-motion preference.

Accordion behavior variants

Accordions differ mainly in how many panels may be open at once and whether one panel starts expanded. These choices affect how easily users can compare content and how much the page shifts during interaction.

VariantBehaviorBest suited forMain drawback
Single-expandOpening one panel closes the othersStep-like content, short panelsPrevents side-by-side comparison
Multi-expandAny number of panels stay openFAQs, reference contentPage can grow very long
Default-openFirst panel expanded on loadHighlighting the most relevant sectionMay hide that other content exists
NestedPanels contain inner accordionsDeep hierarchies such as filtersDisorienting beyond two levels
Common accordion behavior models

Usability research consistently favors multi-expand behavior for most content, because automatically closing a panel the user did not touch can feel unpredictable and causes the page to jump unexpectedly. Single-expand behavior remains reasonable when panels represent sequential steps, though a stepper is often clearer for true sequences.

The accordion is one of several patterns for organizing content in limited space, and choosing the wrong one is a frequent design error. Tabs, dropdown menus, popovers and modal dialogs each solve a similar problem with different trade-offs.

PatternContent visibilityComparison of sectionsMobile suitability
AccordionSeveral sections can be visiblePossible with multi-expandExcellent
TabsOne section at a timeDifficultLimited by horizontal space
Dropdown menuOptions appear temporarilyNot intendedGood
PopoverSmall overlay near a triggerNot intendedFair
Modal dialogBlocks the underlying pageNot intendedFair
Accordion versus neighboring patterns

As a rule of thumb, tabs suit a few parallel views of similar weight, while accordions suit many sections with descriptive titles, particularly on narrow viewports. Many responsive designs convert desktop tabs into an accordion on mobile for exactly this reason.

Accessibility requirements for accordions

An accessible accordion must expose its state and structure to assistive technology and support full keyboard operation. The WAI-ARIA Authoring Practices describe the expected pattern, which also aligns with the WCAG success criteria for keyboard access and name, role and value.

  • Each header contains a native button element wrapped in a heading of the appropriate level.
  • The button carries aria-expanded set to true or false to announce the state.
  • The button references its panel through aria-controls, and the panel may use the region role with a label.
  • Enter and Space toggle the panel; arrow keys may optionally move focus between headers.
  • A visible focus indicator must remain on the header after activation.

The native HTML details and summary elements provide a simple accordion with built-in keyboard support. They are a sensible starting point, although styling and screen reader behavior vary slightly between browsers and should be tested.

When to use an accordion and common mistakes

Accordions work best when users need only part of the content and can judge relevance from the header alone. They work poorly when most users need most of the content, because every extra click adds interaction cost and hides information from in-page search and quick scanning.

MistakeConsequenceFix
Vague header labelsUsers cannot predict panel contentWrite specific, scannable titles
Hiding essential informationKey details are missedKeep critical content visible
Small tap targetHard to activate on touch screensMake the full header row clickable, at least 44 pixels high
No state indicatorUsers cannot tell what is openAdd a rotating chevron or plus icon
Deep nestingUsers lose orientationLimit nesting to two levels
Accordion design mistakes and fixes

Teams should also consider search and linking. Content inside collapsed panels may not be found with the browser’s find function, so well-built accordions expand automatically when a deep link or search match targets a hidden panel.

The simple explanation

Think of an accordion as a stack of labeled folders. You see only the folder names at first, and when you tap one, it opens to show what is inside. Tap it again and it closes, so the stack stays neat.

This saves space and spares people from scrolling through text they do not need. The key idea is simple: show the titles, hide the details until someone asks for them.

How it is used in practice

An online electronics retailer redesigns its mobile product page for laptops. The old page listed specifications, shipping terms, warranty details, reviews and a long FAQ one after another, forcing shoppers to scroll through about eight screen heights before reaching reviews.

The design team keeps the price, key specifications and the purchase button always visible, and moves five secondary sections into a multi-expand accordion. Each header is a full-width button 56 pixels tall, labeled with specific titles such as “Shipping and delivery times” and “Warranty and returns”. The headers use aria-expanded and are fully operable by keyboard.

In usability testing, participants locate return policy details faster, and the page becomes roughly one third as long when collapsed. Because reviews appear in their own expanded section by default, shoppers still see social proof without extra effort, and the team reports a clearer, less cluttered product page.