Skip to content

TabBar

Bottom navigation between the top-level screens of a mobile app: icon plus label, current screen marked.

  • Pro, mobile
  • Version 2.0.0-rc.1
  • APG pattern: Navigation (links)

Examples

Still previews of the real component, rendered from its stories. Pro code isn’t public, so nothing in them responds. Switch the theme and density for every preview at once.

Tokens

The 10 design tokens TabBar reads, with the value each has in the theme and density chosen above. Change a token and the component follows, in Figma and in code.

Show all 10 tokens
Tokens TabBar reads
TokenValue nowCSS variable
color.action.danger…--sd-color-action-danger
color.bg.brand-subtle…--sd-color-bg-brand-subtle
color.bg.canvas…--sd-color-bg-canvas
color.border.default…--sd-color-border-default
color.icon.brand…--sd-color-icon-brand
color.text.default…--sd-color-text-default
color.text.on-action…--sd-color-text-on-action
color.text.secondary…--sd-color-text-secondary
layer.sticky…--sd-layer-sticky
radius.full…--sd-radius-full

Install

Pro components come as source from the SuperDuper registry, with a licence key from Solo, Team or Studio. The registry and checkout aren’t open yet.

Add it from the registry (Pro licence key)

npx shadcn@latest add @superduperui/tab-bar

Then import it

import { TabBar } from "@/components/ui/tab-bar"

Props

TabBar props
PropTypeWhat it does
itemsrequiredTabBarItem[]
aria-labelstringDefault 'Main'Names the navigation landmark. Default "Main".
fixedbooleanDefault truePin to the bottom of the viewport. Default true.
classNamestring

When to use it

Use it for

  • 3 to 5 top-level screens of a mobile app

Use something else for

  • Switching panels within a screen: use Tabs
  • Desktop: use Navbar or Sidebar

Accessibility

Screen readers announce "Main, navigation" then "Home, current page, link".

WCAG 2.2 AAA criteria the component meets in Comfortable density: 1.4.6, 1.4.9, 2.1.3, 2.3.2, 2.4.13, 2.5.5, 2.5.6.

Compact density meets AA (2.5.8, 24px targets), not AAA.

What your product still has to do

  • Keep labels to one or two short words

Shared patterns it ships with: 2.4.8 (aria-current="page").

This release’s test results

Test results for TabBar in this release
axe-core (WCAG A, AA, AAA and best practice)40 runs across every story, theme, density and width: 0 violations
Rendered text contrast175 text runs: 0 below 7:1, lowest 8.43:1
Target size48 targets: 0 under 44px in Comfortable
Focus appearance (2.4.13)72 focus stops in 3 browser engines: all pass
Keyboard scriptChromium 3 of 3, Firefox 3 of 3, WebKit 3 of 3

Manual passes with VoiceOver and NVDA haven’t been done yet.

Keyboard

Each step is scripted and run in Chromium, Firefox and WebKit.

TabBar keyboard steps
KeyWhat happens
TabTab reaches the current screen
TabTab moves along; the badge count is part of the name
EnterEnter goes to the screen

In Figma

The Figma component is TabBar. The Figma library isn’t published yet.

Figma to code: Items → items; nested Item → items.