Skip to content

CSS Showcase · Live Demo

Tabs — one component, five patterns.

Underline bars, segmented pills, a vertical side rail, a scroll-snapping mobile strip, and a bottom tab bar. Disabled tabs are skipped by keyboard, long labels truncate, and the tablist stays overflow-safe — pick a device, then pick a pattern for that device.

Featured demo

mobile · scroll

Overview

Snapshot of today's activity, revenue and top events.

Visits
482
Signups
137
Revenue
916
Churn
24

Try it: ← → skip disabled tabs, Home End jump to first / last enabled.

mobile design patterns

tabs-scroll.css
/* Mobile scroll-snap strip */
.tablist[data-pattern="scroll"] {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--border);
}
.tablist[data-pattern="scroll"] .tab {
  scroll-snap-align: start;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 9rem;
  border-bottom: 2px solid transparent;
}
.tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

CSS & a11y features used

  • • Container queries
  • • Overflow-x scroll + snap
  • • Roving tabindex
  • • Skips aria-disabled tabs
  • • Truncation via min-width:0
  • • aria-orientation keys

CSS Showcase · Share

Share this demo as a 1:1 image

A 2048×2048 PNG with the live current view, the title, and the CSS features — for social posts, docs, and READMEs.

The snapshot follows the device selected on the page — switch between desktop, iPad, and mobile above and the card updates.