Zephora UI

Navigation

Tabs

WAI-ARIA tabs with automatic activation, roving focus, three visual variants and horizontal or vertical orientation.

Import

import { Tabs, TabList, Tab, TabPanel } from "@zephora/react";

Examples

Basic

Link tabs and panels through a shared `value`.

Manage your account details.

Variants

line (default), enclosed and pill.

Enclosed variant.
Pill variant.

Controlled

Drive the selected tab from the outside with `value` + `onValueChange`.

Inbox is empty.

Active: inbox

API

Tabs props

PropTypeDefaultDescription
valuestringControlled selected tab value.
defaultValuestringInitially selected tab value (uncontrolled).
onValueChange(value: string) => voidCalled with the newly selected value.
orientation"horizontal" | "vertical""horizontal"Tab list direction; also switches the arrow-key axis.
variant"line" | "enclosed" | "pill""line"Visual style.
unstyledbooleanfalseHeadless mode — inherited by all parts.

Tab props

PropTypeDefaultDescription
value *stringValue linking this tab to its TabPanel.
disabledbooleanDisables the trigger.
unstyledbooleanOverrides the inherited headless mode.

TabPanel props

PropTypeDefaultDescription
value *stringValue linking this panel to its Tab.
unstyledbooleanOverrides the inherited headless mode.

Keyboard

KeyAction
ArrowRight / ArrowLeftMove focus to the next/previous tab (horizontal); focusing selects it.
ArrowDown / ArrowUpMove focus between tabs when orientation is vertical.
Home / EndFocus the first / last enabled tab.
TabMoves focus from the tab list into the active panel.