Tab Bar
betaA pill of icon tabs whose bright highlight slides to the chosen tab and stretches, gooey, in transit.
- Navigation
- 1 file
- 2 npm packages
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add tab-barnpm packages installed: class-variance-authority, radix-ui.
import { TabBar } from "@/components/ui/tab-bar";Default
Demo
<TabBar>
| Prop | Type | Default |
|---|---|---|
defaultValueInitial selection when uncontrolled. Defaults to the first tab. | string | — |
itemsThe tabs. Defaults to home, search, saved and profile. | TabBarItem[] | DEFAULT_ITEMS |
onValueChange | (value: string) => void | — |
size | "sm" | "md" | "lg" | "md" |
valueControlled selection. | string | — |
Every prop of Radix UI’s RadioGroup.Root, plus className.
Built on the Radix radio group: role="radiogroup" with one role="radio" per tab, each named by its `label` because the icons are aria-hidden. Roving focus moves with the arrow keys (mirrored in right-to-left layouts), Space selects, and the focused tab shows a focus ring. Name the bar with aria-label. The selected tab is also marked by its icon colour against the highlight. Under reduced motion the highlight jumps without stretching.
8/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes