Components · Navigation
Tabs
Layered content panels switched by tab triggers. Built on Radix UI Tabs.
import { Tabs } from '@nexub/react';Usage
Switching between related views within the same page context
Organising content that belongs to the same entity
Reducing visual clutter by hiding secondary content behind tabs
Horizontal navigation within a bounded section
Global site navigation — use the sidebar or top nav
Sequential steps in order — use Stepper
Comparing content side-by-side — keep both views visible
More than 5–7 tabs — consider a Select or sub-navigation
Playground
Props
<Tabs.Root defaultValue="tab1">…</Tabs.Root>Examples
Default
Vertical
orientation="vertical": the indicator slides on the inline-end edge, and arrow up/down move between tabs.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| defaultValue | string | — | Initially active tab value (uncontrolled). |
| value | string | — | Controlled active tab value. |
| onValueChange | (value: string) => void | — | Callback when active tab changes. |
| orientation | 'horizontal' | 'vertical' | 'horizontal' | Layout direction of the tab list. |
Design tokens
Tabs reads these component tokens. Each one is unset by default and falls back to the semantic role it aliases, so nothing changes until you set it. Set one on any element to restyle every Tabs below it, and leave the roles other components share alone. See the three token tiers.
| Token | Aliases | Notes |
|---|---|---|
| --tabs-fg | --color-on-surface-variant | — |
| --tabs-active-fg | --color-primary | Line variant; the pill variant keeps on-surface. |
| --tabs-indicator | --color-primary | The sliding bar of the line variant. |
/* One area of your app */
.checkout {
--tabs-fg: var(--color-secondary);
}On iOS & Android: Tabs
import { Tabs } from '@nexub/react-native';
<Tabs.Root defaultValue="overview">
<Tabs.List accessibilityLabel="Project">
<Tabs.Trigger value="overview">Overview</Tabs.Trigger>
<Tabs.Trigger value="activity">Activity</Tabs.Trigger>
</Tabs.List>
<Tabs.Content value="overview">…</Tabs.Content>
<Tabs.Content value="activity">…</Tabs.Content>
</Tabs.Root>Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Overflow | The list scrolls with edge fades; arrow keys move between tabs. | The list scrolls sideways and centres the active tab; no edge fades. |
| Orientation | Horizontal or vertical. | Horizontal only. |
| Panels | Crossfade in; swipe is not built in. | Swap without a transition; no swipe between panels. |
| Hit area | The trigger height. | sm tabs extend to 44pt up and down with hitSlop. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.