Tabs API
View componentThe full prop reference for the Tabs component. A set of layered sections of content — known as tab panels — displayed one at a time.
Import
import { Tabs } from '@structyl/styled';Props
Tabs.Root
Root container for the tabs component. Manages controlled/uncontrolled tab state and provides context to child components.
| Prop | Type | Default |
|---|---|---|
| value# | stringControlled value of the active tab | — |
| defaultValue# | stringDefault value when uncontrolled | — |
| onValueChange# | (value: string) => voidCallback fired when tab value changes | — |
| orientation# | 'horizontal' | 'vertical'Layout direction of tabs | 'horizontal' |
| dir# | 'ltr' | 'rtl'Text direction; affects focus navigation | — |
| activationMode# | 'automatic' | 'manual'Focus behavior: 'automatic' activates on focus, 'manual' requires Enter/Space | 'automatic' |
| asChild# | booleanRender as child element (Radix Primitive pattern) | — |
| variant# | 'default' | 'underline' | 'pills' | 'enclosed'Visual style variant (styled layer only) | 'default' |
| color# | 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success'Active tab color theme; applies to underline and pills variants (styled layer only) | 'primary' |
| className# | stringCSS class name | — |
Tabs.List
Container for tab triggers. Wraps TabsPrimitive.List with styling and layout controls.
| Prop | Type | Default |
|---|---|---|
| loop# | booleanWrap focus navigation at list edges | true |
| scrollable# | booleanEnable horizontal scrolling with hidden scrollbar (styled layer only) | false |
| asChild# | booleanRender as child element (Radix Primitive pattern) | — |
| className# | stringCSS class name (merges with variant styles) | — |
Tabs.Trigger
Individual tab button. Manages selection, disabled state, and keyboard/mouse interactions.
| Prop | Type | Default |
|---|---|---|
| value# | stringUnique identifier for this tab (required) | — |
| disabled# | booleanDisable tab selection and interactions | — |
| asChild# | booleanRender as child element (Radix Primitive pattern) | — |
| className# | stringCSS class name (merges with variant styles) | — |
Tabs.Content
Content panel for a tab. Only renders when tab is active (unless forceMount is true).
| Prop | Type | Default |
|---|---|---|
| value# | stringTab value this content belongs to (required) | — |
| forceMount# | booleanAlways render content in DOM even when inactive | — |
| asChild# | booleanRender as child element (Radix Primitive pattern) | — |
| className# | stringCSS class name (merges with animation styles) | — |
Keyboard interactions
Adheres to the WAI-ARIA design pattern .
| Key | Description |
|---|---|
| Tab | Moves focus to the active trigger, then the panel. |
| ArrowLeft / ArrowRight | Moves to the previous / next tab. |
| Home / End | Moves to the first / last tab. |
Source code
If you didn't find what you need here, read the component implementation .