Tabs
Tabbed content container with ARIA tablist semantics, size variants, and underline/default strip designs.
npx @slipstream-ui/cli@latest add tabsDefault (pill track)
Account summary, recent activity, and quick actions live here.
Charts of usage over time — conversations, tokens, and latency.
Underline design
Source snippet for the current example.
Rendered output of the example.
Implementation notes and gotchas.
Sizes
sm
md
lg
sm+ul
rounded
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | — | Controlled active tab value. |
| defaultValue | string | — | Initial tab value when uncontrolled. |
| onValueChange | (value: string) => void | — | Called when the active tab changes. |
| variant | 'default' | 'underline' | 'rounded' | 'default' | Strip design: enclosed pill track, background-free underline, or fully-rounded pills. |
| size | 'sm' | 'md' | 'lg' | 'md' | Density for strip and triggers. |
| TabsTrigger className | string | — | Per-trigger overrides (twMerge resolves conflicts with variant/size). |
Accessibility
- role=tablist/tab/tabpanel with aria-selected and aria-controls.
- Roving tabindex: only the active tab is tabbable.
- Full keyboard operation: ArrowLeft/Right + ArrowUp/Down move AND activate (wrapping), Home/End jump to first/last, Enter/Space activate.
- Underline variant keeps a 2px border indicator so state is not color-only.
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+ — macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA — the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.