Skip to content
Zuno UI
Explore components
EXPLORE
Actions
Forms
Layout
Navigation
Data display
Feedback
Overlays
RESOURCES

Tabs

Sections with distinct selection and focus states.

Base UI reference ↗
Your account details.

Installation

Run it from the root of a project already set up with zunoui init.

npx zunoui@latest add tabs

Dependencies

What add tabs installs alongside the component. The CLI skips any you already have in a compatible version.

ZUNO registry

  • @zuno/utils

npm

Examples

8 examples · 1 component
tabs
Your account details.

Segmented (default)

A compact group on a soft surface.

tabs
General preferences.

Underline

A clean documentation style: a bottom indicator on the active tab.

tabs
Daily view.

Ghost

No background surface; the active tab is highlighted minimally.

tabs
Recent activity.

Solid

The active tab is filled with the brand color and contrasting text.

tabs
General view.

With icons

Compose an Icon before the text and use gap to space it. The icon is decorative (the text already names the tab).

tabs
Recent activity.

Pill shape

shape="pill" fully rounds the container and the active pill.

tabs
General preferences.

Indicator on top

indicatorPosition="top" moves the bar to the top edge of the active tab.

tabs
Daily view.

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.

PropTypeDefault
variant

Visual style of the tab group; solid fills the active tab with the brand color.

"segmented" | "underline" | "ghost" | "solid""segmented"
shape

pill fully rounds the container and the active pill; in underline it thickens the bar.

"rounded" | "pill""rounded"
indicatorPosition

Side of the indicator in the underline variant.

"bottom" | "top""bottom"
Tabs

Root; accepts defaultValue, value and onValueChange.

div—
TabsList

Container for the tabs.

div—
TabsTab

A tab; requires value.

button—
TabsPanel

Content; requires a matching value.

div—

States

The states that apply to this component and their visual treatment.

StateTreatment
Inactive tabMuted text without a highlighted surface.
SelectedBackground or underline and contrast, not color alone.
Focus visibleKeyboard outline on the tab; arrow keys move focus.
Active panelThe panel is focusable so navigation can continue.
DisabledA 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.