Skip to content
Bugwise
Menu
UI Components

Accordion

Stacked sections that open and close to show more detail. Learn single vs multiple open, deep links, find-in-page, scroll jumps and the screen reader states that testers check on every FAQ and order page.

35 min Content & layout iOS · Android · Web Also called: Expandable section, Collapsible, Disclosure, FAQ

You click the “Track your return” link in an email. The shop opens the order page, scrolls down a bit… and shows a closed section called Returns. You click the title. Nothing. You click it again. Nothing. Finally you spot the tiny arrow on the right, click it, and the section opens, while the arrow keeps pointing down.

That’s four bugs in ten seconds, all in one of the “simplest” components on the web. Accordions hide content, and hidden content is where bugs hide too: in the state, the scroll position, links, search and screen readers. Let’s learn to find them.

What is an accordion?

An accordion is a vertical stack of sections, each with a header that opens or closes its content. Closed, you only see the headers, so a long page becomes a short, scannable list. Open, a section pushes the content below it down, like the bellows of an accordion.

One single open/close section is often called a disclosure (or “collapsible”, “expandable section”). An accordion is a group of them.

You’ll usually see accordions in:

  • FAQ and help pages: How do I return an item? Can I change my address?
  • Order and booking details: Delivery · Items · Payment · Returns.
  • Product pages on mobile: Description · Size & fit · Shipping.
  • Settings and filters: Price, Brand, Size in a shop’s filter panel; advanced options in a form.

Anatomy

A web accordion: one section open

  1. 1

    Container

    Groups related sections, like the questions of one FAQ. Usually a list with dividers or separate cards.

  2. 2

    Header (trigger)

    The whole row is one button. Tapping anywhere on it opens or closes the section, not just the arrow.

  3. 3

    Title

    Names the section in a few words. On the web it sits inside a heading, so screen reader users can jump between sections.

  4. 4

    Summary (optional)

    A short preview of what is inside, e.g. “Delivered 6 Oct”. Saves a tap for the most common question.

  5. 5

    Chevron (state indicator)

    Points down when closed and up when open (or right → down). It must always match the real state.

  6. 6

    Panel (content)

    Shown only while the section is open. Can hold text, lists, links and buttons.

  7. 7

    Divider

    Separates sections so users can see where one ends and the next begins.

How it differs from similar components

ComponentWhat it doesTypical use
AccordionShows or hides sections in place; several can be visibleFAQ, order details
TabsShows exactly one section at a time, labels side by sideOverview / Specs / Reviews
“Show more” linkReveals the rest of one text blockLong product description
DropdownOpens a list to pick a valueCountry, size
Modal / sheetOpens content on top of the pageConfirmations, forms
Dev note: Names differ by platform

Designers say accordion, the HTML standard has <details> and <summary>, the WAI-ARIA guide calls one section a disclosure, SwiftUI calls it a DisclosureGroup, and Android developers talk about expandable list items. It’s the same idea: a header that shows or hides content.

Designs & variants

The look differs a lot between platforms, but every variant has a header, a state indicator and a panel. Try them all, with the mouse and with the keyboard (Tab, then Enter or Space).

Help · Orders

Standard delivery takes 2–4 working days. You get a tracking link by email as soon as the parcel leaves our warehouse.

FAQ accordion

Web

One question open at a time: opening one closes the others. The whole row is a button inside a heading.

Single openaria-expandedHeading + button

Trail runner 2 · €129

Shipping

Free over €50. Express (next day) €6.90.

Returns

30 days, free label. Refund within 5 days of arrival.

Size & fit

Runs small. If you are between sizes, pick the larger one.

Native details / summary

Web

Built into HTML: keyboard, state and screen reader support for free. A shared name attribute makes the group exclusive.

<details>name = exclusiveFind in page

Order #4821

Details

StatusDelivered
  • Desk lamp · €39.90
  • LED bulb ×2 · €15.00
  • Gift wrap · €0.00

Disclosure group

iOS

A row with a chevron that turns from right to down. Common in Settings-style lists and sidebars, usually multiple open.

Chevron → downInset listVoiceOver

Expandable card

Android

Material 3 has no dedicated accordion component. Apps build expandable list items or cards with an expand icon.

Expand icon48 dp targetTalkBack

Single or multiple open?

  • Multiple open (the default on most platforms): each section opens and closes on its own. Best when users may want to compare sections or keep several open, like filters or order details.
  • Single open (an “exclusive” accordion): opening one closes the others. It keeps the page short, but users can’t see two answers at once, and closing a long section above can move the section you just opened (more on that below).

Neither is wrong. The bug is when the product says one thing and the app does another, or when the two modes are mixed on similar pages.

Default open state

Decide, document and test which sections start open:

When to use it

Accordions work well when:

  • The page has many sections and users only need one or two of them (FAQs, help, order details).
  • Each section has a clear, predictable title, so users can tell what’s inside without opening it.
  • The content is secondary or reference material, and the screen is small.
  • Users don’t need to compare content across sections at the same time.

Good and bad uses

Lots of optional detail

Users scan the questions and open the one they care about.

Hiding what everyone must see

The real price and the fees are hidden behind taps. Critical information belongs on the page, not in a closed section.

One level of sections

Flat and predictable.

Accordions inside accordions

Three levels deep, users lose track of where they are and which arrow belongs to which header. Use separate pages or a list with headings.

How good accordions behave

Most accordion bugs are not about colors. They are about state, focus and scrolling. These are the rules to test against.

The indicator tells the truth

The chevron points down when closed and up when open (on iOS: right when closed, down when open). Whatever opens or closes a section (a tap, the keyboard, “Expand all”, a link, the default state on load) the chevron, the panel and the screen reader state must agree. A chevron that’s driven by its own variable instead of the real open state drifts out of sync quickly.

The whole header is the button

Users tap the title, not the arrow. The entire header row must react, with a touch targetTouch targetThe area of the screen that responds to a tap, which should be large enough for a finger.Open in glossary → of at least 44×44 pt on iOS and 48×48 dp on Android. A tiny chevron that’s the only clickable part fails users with shaky hands, and feels broken to everyone else.

Opening doesn’t lose your place

Opening and closing changes the height of the page, so things move. Test with long content:

  • In single-open mode, opening a section below a long open section closes the long one. Everything moves up, and the header you just tapped can jump out of view. Good implementations keep the tapped header where it was.
  • Code that “scrolls the new content into view” must scroll to the header, not to the end of the panel. Otherwise long panels push their own header off-screen.
  • Closing a long section while you’re scrolled inside it should leave you on its header, not somewhere random further down the page.
  • On the web, check that the page height update doesn’t make the browser’s scroll anchoring jump in odd ways, and on phones check rotation (reflowReflowContent rearranging into a single column at narrow widths or high zoom, without sideways scrolling.Open in glossary →).

Animation respects “Reduce motion”

A short height animation (about 200–300 ms) helps users see where the content came from. But users who turn on Reduce motion (iOS), Remove animations (Android) or prefers-reduced-motion (web) should get an instant change or a simple fade. Also check that fast double taps during the animation don’t leave the section half-open or out of sync with the chevron.

FAQ and help pages are full of links like shop.example.com/help#returns, and apps get deep linksDeep linkA link that opens a specific screen inside an app instead of just its home screen.Open in glossary → like shop://orders/4821/returns. The link must open the target section and scroll its header into view, both when the page loads and when the user clicks an in-page link. Scrolling to a closed header, or opening the section without scrolling to it, are both bugs.

Find in page and hidden content

Press Ctrl+F (Cmd+F on a Mac) and search for a word that’s inside a closed section. On most custom accordions, the browser finds nothing, because closed content is hidden. Users then think the answer doesn’t exist.

Dev note
Closed content is hidden with display: none.

Two web features help:

  • Native <details>: Chrome, Edge and recent Firefox versions search inside closed <details> elements and open the one with the match. Safari added this later, so check it there too.
  • hidden="until-found": a custom accordion can hide its panel this way. The browser can still search it and reveals the section (the page should then update its chevron). Chromium browsers and recent Firefox support it; Safari support is newer and partial at the time of writing, so test in your target browsers.
    Dev note
    The browser fires a beforematch event; the page should also update aria-expanded.

Common bugs

#BugWhat you seeSeverity
1Chevron out of syncArrow points down while the section is open, or doesn’t turn after “Expand all”Low–Medium
2Only the arrow is clickableClicking the title does nothingMedium
3Scroll jumpAfter opening a section, its header is off-screenMedium
4Wrong screen reader stateVoiceOver says “collapsed” for an open sectionHigh (for affected users)
5Deep link lands on a closed section#returns scrolls there but doesn’t open itMedium
6“Expand all” out of syncThe button says “Expand all” while everything is openLow
7Hidden content not searchableCtrl+F finds nothing that’s inside a closed sectionLow–Medium
8Content cut offLong text, large fonts or a late image are clipped at a fixed heightMedium–High
9Focus lost or trappedAfter closing, focus jumps to the top; or links in a closed panel are still Tab stopsMedium
10Double tap breaks itFast taps during the animation leave a half-open sectionLow

Stress-test it

This is a correct accordion on a banking help page. Change the settings and watch what happens. Use the mouse, then only the keyboard.

Mode
Motion
Closed content
Scroll fix

Help · Cards

Answers to the questions we hear most about cards.

Paying by card in another currency is free on all plans. Cash withdrawals:

  • Standard: 2 free per month, then 1.7%
  • Plus: €400 per month free, then 1%
  • Premium: unlimited free withdrawals

On weekends we add 0.5% to the exchange rate for most currencies, because markets are closed. Some ATMs charge their own fee. Always choose to be charged in the local currency: if the ATM converts for you, the rate is usually much worse.

Traveling for more than 3 months? Tell us in the app so we don't block your card for unusual activity.

Fees are shown in the transaction details right after each payment.

Still need help?

Chat with us in the app, 24/7. Average reply time: 2 minutes.

Card issued by Example Bank. Fees as of October 2026.

Screen reader would say

Tab to a question or click one to hear it…

Event log

  • Open and close questions, or use the link.

Things to try: in Single mode with the scroll fix Off, scroll down through the long “fees abroad” answer and tap the next question: the header you tapped jumps out of view. Turn the fix On and repeat. Then switch Closed content to Until-found, close everything and press Ctrl+F / Cmd+F to search for BLUEFIN (works in browsers that support it, like Chrome and Edge).

Find the bug

This order page in a web shop has an accordion with six bugs. Explore it like a tester:

  • Click the titles, not just the arrows, and watch the arrows.
  • Open the long Items section and look at where its header went.
  • Use Expand all, then open and close sections by hand.
  • Use the email link and the “See returns” link inside Delivery.
  • Tab through the page and read the screen reader panel.

🐞 Bug hunt: Order #4821

This demo has 6 hidden bugs. Explore it like a tester, then check your findings.

Found0/6
shop.example.com/orders/4821
nordic·homeMy account

My orders ›

Order #4821

Delivered

Placed 3 Oct · 8 items · €174.50

Order details

Delivery

Delivered Mon 6 Oct

Delivered on Monday 6 October at 14:12 to parcel locker “Hauptbahnhof 3”, compartment 41.

Something wrong with your order? See returns

Items (6)

8 pieces from 1 seller

Payment

Visa •••• 4242

Returns

Free returns until 5 Nov

Help with this order

Chat or call us

Tester tools

Screen reader would say

Tab to a control or click one to hear it…

  1. 1

    Hint: Look at the Delivery section when the page loads. Then try Expand all.

  2. 2

    Hint: Click a section title.

  3. 3

    Hint: Open the long Items section and look for its title.

  4. 4

    Hint: Open a section, then Tab to its arrow and read the screen reader panel.

  5. 5

    Hint: Use the email link, or “See returns” inside Delivery.

  6. 6

    Hint: Open every section by hand, then look at the button. Or use Expand all and close them by hand.

How to test it

Checklist

Accordion test checklist

0 of 13 checked

Example test cases

TC-ACC-001Default state on load

Preconditions

  • Delivered order #4821 exists

Steps

  1. Open My orders › #4821

Expected result

Only "Delivery" is open, its chevron points up; all other sections are closed with chevrons pointing down.

TC-ACC-002Whole header toggles the section

Steps

  1. Click the "Payment" title text
  2. Click the empty space in the middle of the header
  3. Click the chevron

Expected result

Each click toggles the section (open, closed, open). The chevron turns every time.

TC-ACC-003Opening a long section keeps its header visible

Preconditions

  • Order with 6+ items
  • Phone-sized viewport (360 × 640)

Steps

  1. Scroll until "Items (6)" is near the bottom of the screen
  2. Tap "Items (6)"

Expected result

The header "Items (6)" stays visible and the list opens below it. The page does not jump past the header.

TC-ACC-004Deep link opens the target section

Steps

  1. Open shop.example.com/orders/4821#returns in a new tab
  2. Click "See returns" in the Delivery section

Expected result

In both cases "Returns" is expanded and its header is at the top of the view.

TC-ACC-005"Expand all" label after manual changes

Steps

  1. Open every section one by one
  2. Look at the button
  3. Click it
  4. Close one section by hand

Expected result

After step 1 the button says "Collapse all". Clicking it closes all and it says "Expand all". After step 4 it still says "Expand all".

TC-ACC-006Screen reader announces the state

Preconditions

  • VoiceOver (macOS / iOS) or NVDA (Windows) on

Steps

  1. Move to the "Payment" header
  2. Press Enter (or double-tap)
  3. Press Enter again

Expected result

Announced as "Payment, button, collapsed, heading level 3", then "expanded", then "collapsed".

TC-ACC-007Find in page reaches closed content

Preconditions

  • Chrome or Edge
  • All FAQ sections closed

Steps

  1. Press Ctrl+F / Cmd+F
  2. Search for "parcel locker" (text inside a closed answer)

Expected result

The match is found and its section opens automatically (if the team uses details or hidden="until-found"). Otherwise, log it as an improvement.

TC-ACC-008Reduce motion

Preconditions

  • iOS: Settings › Accessibility › Motion › Reduce Motion on (or the OS equivalent)

Steps

  1. Open and close each section
  2. Double-tap a header quickly

Expected result

Sections open and close without a sliding animation (or with a simple fade). After the double tap the section and chevron agree.

Tip: click a test case to expand it.

Tools

  • Elements panel in DevTools: click a header and watch aria-expanded change live in the DOM. If it never changes, you’ve found bug #4 without a screen reader.
  • Accessibility pane / Lighthouse: shows the computed role, name and state of each header.
  • Reduced motion on the web: DevTools › Cmd/Ctrl+Shift+P › “Emulate CSS prefers-reduced-motion”.
  • Deep links: paste URLs with #section into a new tab; on Android use adb shell am start -a android.intent.action.VIEW -d "shop://orders/4821/returns", on the iOS Simulator xcrun simctl openurl booted "shop://orders/4821/returns".

Accessibility

Mobile vs web

  • The chevron points right when closed and turns down when open.
    Dev note
    SwiftUI has DisclosureGroup (and OutlineGroup / lists with children for trees); UIKit lists use an outline disclosure accessory.
  • Common in Settings-style lists, sidebars and forms. Multiple sections can be open.
  • Test VoiceOver (state and hint), Reduce Motion, the largest Dynamic Type size (long titles must wrap, not truncate) and the iPad sidebar.
  • Material 3 has no official accordion component. Apps build expandable list items or cards.
    Dev note
    With an expand_more icon; older apps use ExpandableListView.
  • Test that TalkBack says “expanded” / “collapsed”.
    Dev note
    In Jetpack Compose, the expanded state should be exposed to TalkBack (state description and expand / collapse actions).
  • Check rotation and process death: does the open section survive? Test Remove animations in Accessibility settings and the largest font size and display size.
  • Inspect the headers in DevTools.
    Dev note
    Prefer <details>/<summary> or the ARIA accordion pattern (heading + button + aria-expanded).
  • Test #anchors and deep links, Ctrl+F, browser Back after following a link, and 200% zoom.
  • Check what happens when JavaScript is slow or fails: is the content still reachable, or stuck closed? And for SEO pages, is the content in the HTML or fetched on open?

Check your understanding

Quick quiz

0/5 answered · 0 correct

  1. 1.A section is open, but VoiceOver says "Payment, button, collapsed". What is the most likely cause?

  2. 2.Which is the best place for an accordion?

  3. 3.A link to /help#returns scrolls to the Returns header, but the section stays closed. Is this a bug?

  4. 4.In single-open mode, you tap a section below a long open section and the tapped header disappears off the top. Why?

  5. 5.What does hidden="until-found" do?

Key takeaways

  • An accordion is a stack of headers that show or hide content in place. Use it for lots of optional detail, never to hide prices, fees or errors.
  • The whole header is the button, and the chevron, panel and aria-expanded must always agree.
  • Test long content: scroll jumps in single-open mode, panels scrolled to the end, text cut off at a fixed height.
  • Deep links must open the section they point to, and closed content should still be findable (<details>, hidden="until-found").
  • Always test with the keyboard, a screen reader, Reduce motion and the largest text size.

Finished this page?Nice work, this page is complete!

Mark it as done to track your progress. It's saved in this browser, no account needed.

Its review cards are now in Bites ⚡
Esc

Type to search the whole site.