Skip to main content

BETANow in public beta.Public betaBeta

日本語Español

TAB-004 Published · Updated

Mobile accordion tabs

A design that switches content with tabs on desktop and shows the same content as a vertically stacked accordion on mobile.

FigmaThis part is included in our free, editable Figma file: 235 website UI patterns across 32 parts, 2 designs each Open in Figma Community ↗ (opens in a new tab)

Wireframe (desktop) | Mobile accordion tabs

Mobile accordion tabs UI design (desktop wireframe)

Wireframe (mobile) | Mobile accordion tabs

Mobile accordion tabs UI design (mobile wireframe)

What changes on mobile

  1. A vertically stacked accordion: Stops the tabs overflowing sideways and hiding some of the names.
  2. The first item open (where needed): Shows that items open and hold content. With enough explanation at the top of the page, all closed works too.

Before you choose this pattern | Mobile accordion tabs

Good fit

  • Tabs on desktop, but the tabs would not fit a mobile screen
  • Four or more items with names on the long side
  • On mobile, readers should see the list of names before choosing what to open

Poor fit

  • Two or three items whose tabs fit on one line even on mobile (the <a href="/patterns/en/tabs-segment/">segmented tabs</a> are enough)

Why this wireframe works | Mobile accordion tabs

Every item name visible on mobile

On mobile the tabs become a vertically stacked accordion, so every name is visible without scrolling sideways.

Several items open at once on mobile

In an accordion, readers can keep as many items open as they like. The one-at-a-time limit of tabs disappears.

Roles that match each shape

On desktop the tab roles (tab, tabpanel) are used; on mobile the disclosure-button role (aria-expanded). Not only the look changes; how the control is described to screen readers matches each shape.

The same content on desktop and mobile

The headings, descriptions and bullets are the same on desktop and mobile, so mobile never ends up with less content.

Common mistakes | Mobile accordion tabs

The tab role kept on the mobile accordion

If role=”tab” remains after the look changes to an accordion, the screen reader describes an operation that does not match. Change the role to a disclosure button (aria-expanded) along with the shape.

The same content written twice

Writing the same text once for the tabs and once for the accordion means one copy gets missed on every edit. Keep the content in one place and switch only the presentation.

Every item closed on mobile

With everything closed, readers may not realize there is content inside. When the explanation at the top of the page is not enough, opening the first item shows that items can be opened.

Unclear open/close marks

Without “+”, “−” or an arrow, nothing says that pressing opens the item. Add the mark, and convey the state with aria-expanded too.

Not carrying state across the PC/mobile role switch

When switching between PC tablist, tab and tabpanel and mobile heading buttons with aria-expanded, take the hidden controls out of the focus order and carry over the selected item and open state.

FAQ | Mobile accordion tabs

Do I need two sets of HTML for desktop and mobile?

To avoid writing the content twice, one set of HTML can be rearranged with JavaScript, or the headings and content can be shared components used by both. The point is to have one place to edit.

At what width should it switch?

At the width where the tabs no longer fit on one line. It depends on the number of items and the length of the names, so test by changing the width.

Are there cases where tabs should stay tabs on mobile?

With two or three items with short names that fit on one line, tabs are fine on mobile too.

Related pages

Share this pattern

Send this page to your team or your design partner.

Was this pattern useful?

Written by

Yuta Okano

ENVY DESIGN Inc.

CEO / Director / Designer

14 years in the web industry. Has worked on more than 500 web projects, from corporate and recruiting sites to e-commerce. Focuses on information architecture, direction and design, from planning websites to improving them. In recent years he has focused on AIO (AI optimization) and GEO, helping sites get cited by generative AI search such as ChatGPT, Perplexity and Google AI Overviews.

Review and revision history

  1. Published AvatarYuta Okano Pattern published