Tabs
Switch between related panels without leaving the page.
Switch between related panels without leaving the page.
Backed by Base UI Tabs for upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on this page.
Import
Section titled “Import”import { Tabs } from "@zentara-co/zenos-ui";Variants
Section titled “Variants”default renders a connected segmented control with end-cap rounding. underline uses a bottom selection indicator and works well for page-level sections. Pair tabs with icons and Badge counts; active tabs style nested [data-slot=badge] for primary counts. Set the variant on Tabs.List; every tab inherits it unless explicitly overridden.
Tabs are horizontal. Use default for compact view switching and underline for broader content sections. If a vertical layout or URL navigation is required, use an appropriate navigation component instead.
Custom styling
Section titled “Custom styling”Every Tabs part accepts className. Style individual parts directly, or scope a cohesive treatment from Tabs.List with stable data-slot attributes and Base UI’s data-active state. Keep selection, disabled state, and other behavior in their dedicated props.
Controlled and disabled
Section titled “Controlled and disabled”Use value with onValueChange when application state owns the active panel. Disabled tabs remain visible but are skipped by pointer and keyboard activation.
Active tab: overview
Animated indicator
Section titled “Animated indicator”Tabs.Indicator is optional. Place it inside a default list when one moving selection surface should sit behind the tabs. The indicator follows the active tab’s measured position and disables its transition under reduced motion. The underline variant already draws its active marker and does not need this part.
Long tab lists
Section titled “Long tab lists”When all labels remain useful, place the list in a horizontal overflow container rather than compressing or wrapping tabs into multiple lines. For large information architectures, consider navigation instead of an excessively long tab set.
Variants
defaultunderline Tabs.Root Tabs.List Tabs.Tab Tabs.Indicator Tabs.Content
API
| Prop | Type | Default | Description |
|---|---|---|---|
Root.value | string | — | Controlled active tab. |
Root.defaultValue | string | — | Initial uncontrolled tab. |
Root.onValueChange | (value: string, eventDetails) => void | — | Runs when active tab changes. |
Root.activationMode | automatic | manual | automatic | Controls whether focus or explicit activation selects a tab. |
List.variant | default | underline | default | Visual treatment inherited by tabs in the list. |
Tab.disabled | boolean | false | Prevents a tab from receiving activation. |
Tab.variant | default | underline | — | Overrides the visual treatment inherited from Tabs.List. |
native props | React.Base UI Tabs props | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”Tabs preserve Base UI’s tab, tablist, and tabpanel relationships. Left and Right Arrow move between tabs; Home and End move to the first and last enabled tabs. Enter or Space activates a focused tab when activation is manual. Keep labels short, ensure every tab has a corresponding panel, and do not use Tabs as site navigation.