Skip to content
IndexRequest a UIAboutContact

Scrollable Tab Bar

A tab bar with more tabs than fit: edge fades hint at hidden tabs, arrows scroll, and the chosen tab scrolls into view.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Clean UI mockup of a horizontal scrollable tab bar with ten tabs, Overview, Design, Motion, Typography, Colour, Layout, Accessibility, Code, Prompts and Examples, the tab Typography selected with a dark underline, a soft white fade at the right edge where Examples is cut off and a small round arrow button at the right, content area below with a short paragraph, light theme, flat modern style. Negative: heavy shadows, clutter, text errors, device frames. Reduced motion: static mockup.

About this pattern

Definition

When there are more tabs than fit, a scrollable tab bar keeps them on one line instead of wrapping or hiding them. Fades at the edges show that more tabs exist, arrow buttons scroll for mouse users, and the selected tab is scrolled into view so it never hides off screen.

Purpose & UX principles

  • Use overflow-x: auto with hidden scrollbars but keep scrolling via touch, wheel and arrows.
  • Show an edge fade or arrow only on the side where more tabs exist.
  • Scroll the selected tab into view when it changes, also from the keyboard.
  • Follow the tabs pattern: role tablist, arrow keys to move, Home and End.

Interaction states

  • Ten tabs, arrow buttons and keyboard control.

Motion specification

  • Scrolling is smooth over about 250ms.
  • Reduced motion: scrolling jumps instantly.

Responsive behaviour

  • Put the most used tabs first.
  • If there are more than about eight tabs, consider a menu instead.

Code

HTML
<div class="bx"><div class="tw" id="tw"><button class="ar l" id="al" type="button" aria-label="Scroll tabs left" hidden>‹</button><div class="tl" id="tl" role="tablist" aria-label="Sections"></div><button class="ar r" id="ar" type="button" aria-label="Scroll tabs right">›</button></div><div class="pn" id="pn" role="tabpanel" tabindex="0"></div></div>

Related patterns

Tab Navigation

↗
Tab NavigationNavigation

Segmented Control

↗
Segmented ControlInputs & Forms

Bottom Navigation

↗
Bottom NavigationNavigation