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.
| Part | Role | Typical implementation |
|---|---|---|
| Header | Labels the section and acts as the trigger | A button inside a heading element |
| Disclosure icon | Signals the open or closed state | Chevron that rotates 90 or 180 degrees |
| Panel | Holds the hidden content | Region linked to its header |
| Divider | Separates items visually | Thin border or spacing |
| Container | Groups all items as one component | List or wrapper element |
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.
| Variant | Behavior | Best suited for | Main drawback |
|---|---|---|---|
| Single-expand | Opening one panel closes the others | Step-like content, short panels | Prevents side-by-side comparison |
| Multi-expand | Any number of panels stay open | FAQs, reference content | Page can grow very long |
| Default-open | First panel expanded on load | Highlighting the most relevant section | May hide that other content exists |
| Nested | Panels contain inner accordions | Deep hierarchies such as filters | Disorienting beyond two levels |
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.
Accordion compared with related UI patterns
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.
| Pattern | Content visibility | Comparison of sections | Mobile suitability |
|---|---|---|---|
| Accordion | Several sections can be visible | Possible with multi-expand | Excellent |
| Tabs | One section at a time | Difficult | Limited by horizontal space |
| Dropdown menu | Options appear temporarily | Not intended | Good |
| Popover | Small overlay near a trigger | Not intended | Fair |
| Modal dialog | Blocks the underlying page | Not intended | Fair |
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.
| Mistake | Consequence | Fix |
|---|---|---|
| Vague header labels | Users cannot predict panel content | Write specific, scannable titles |
| Hiding essential information | Key details are missed | Keep critical content visible |
| Small tap target | Hard to activate on touch screens | Make the full header row clickable, at least 44 pixels high |
| No state indicator | Users cannot tell what is open | Add a rotating chevron or plus icon |
| Deep nesting | Users lose orientation | Limit nesting to two levels |
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.