Tabs
Sections with distinct selection and focus states.
Base UI reference ↗Installation
Run it from the root of a project already set up with zunoui init.
npx zunoui@latest add tabsDependencies
What add tabs installs alongside the component. The CLI skips any you already have in a compatible version.
ZUNO registry
@zuno/utils
npm
@base-ui/[email protected]
Examples
8 examples · 1 componentSegmented (default)
A compact group on a soft surface.
Underline
A clean documentation style: a bottom indicator on the active tab.
Ghost
No background surface; the active tab is highlighted minimally.
Solid
The active tab is filled with the brand color and contrasting text.
With icons
Compose an Icon before the text and use gap to space it. The icon is decorative (the text already names the tab).
Pill shape
shape="pill" fully rounds the container and the active pill.
Indicator on top
indicatorPosition="top" moves the bar to the top edge of the active tab.
Thick bar
In underline, shape="pill" thickens the bar into a rounded lozenge.
API reference
Keeps the props, events and refs of the matching Base UI primitive, plus ZUNO's styles.
| Prop | Type | Default |
|---|---|---|
variantVisual style of the tab group; solid fills the active tab with the brand color. | "segmented" | "underline" | "ghost" | "solid" | "segmented" |
shapepill fully rounds the container and the active pill; in underline it thickens the bar. | "rounded" | "pill" | "rounded" |
indicatorPositionSide of the indicator in the underline variant. | "bottom" | "top" | "bottom" |
TabsRoot; accepts defaultValue, value and onValueChange. | div | — |
TabsListContainer for the tabs. | div | — |
TabsTabA tab; requires value. | button | — |
TabsPanelContent; requires a matching value. | div | — |
States
The states that apply to this component and their visual treatment.
| State | Treatment |
|---|---|
| Inactive tab | Muted text without a highlighted surface. |
| Selected | Background or underline and contrast, not color alone. |
| Focus visible | Keyboard outline on the tab; arrow keys move focus. |
| Active panel | The panel is focusable so navigation can continue. |
| Disabled | A disabled tab is skipped in the focus order. |
Accessibility
Arrow keys move focus between tabs and Enter or Space activates one; the panel is focusable.
The active tab is distinguished by background or underline and contrast, not color alone.