API and Development
Tabs pairs a list of triggers with content panels so users can switch between related sections without leaving the page. It wraps Radix UI Tabs with keyboard navigation, ARIA roles, and optional vertical layout.
If you need tab-shaped UI but no content panels, see TabMenu (local state) or TabNav (route navigation).
Name | Type | Default | Description |
|---|---|---|---|
|
| — | default tab value to be active when the component is mounted |
|
| — | renders an aria-label for the tabs component @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-label |
|
| — | id of the element to be used as a label, used as aria-labelledby for the tabs component @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-labelledby |
|
| — | callback function to be called when the tab value changes for *controlled* component |
|
|
| interaction orientation of tabs, horizontal or vertical (defaults to horizontal) note that this is not visual orientation, but used mostly for keyboard navigation arrow direction @link https://github.com/radix-ui/website/issues/463 |
|
| — | current tab value to be active when the *controlled* component is mounted |
Interactive examples and edge cases for this component are in Storybook.
Name | Type | Default | Description |
|---|---|---|---|
|
|
| TabsTrigger components. |
|
|
| Visual layout of triggers. |
|
|
| Bottom border under triggers. |
|
|
| Animated active indicator. |
Name | Type | Default | Description |
|---|---|---|---|
|
|
| Identifies this trigger. |
|
|
| Label content. |
|
|
| Compact sizing. |
|
|
| Badge when greater than zero. |
|
|
| Icon before the label. |
|
|
| Accessible name for lead icon. |
Name | Type | Default | Description |
|---|---|---|---|
|
|
| Must match a TabsTrigger value. |
|
|
| Content shown when this tab is active. |
| Scenario | Component | Why |
|---|---|---|
| Switch between content panels on one page | Tabs | Manages content visibility with TabsContent. |
| Filter or view-switch without URL change | TabMenu | Thin wrapper around Tabs—no content panels, just selection state. |
| Navigate to different routes (URL changes) | TabNav | Renders <a> links with SPA navigation and pathname matching. |