Tabs
stableA set of layered sections of content — known as tab panels — displayed one at a time.
Basic usage
Make changes to your account here.
Examples
Three tabs
Multiple tabs for account, password, and billing settings.
Make changes to your account here.
Account settings layout
Tabs can organize forms and large detail panels without leaving the page.
Semantic colors
Pass color to Tabs.Root to use a semantic accent for the active indicator.
Features
- Can be controlled or uncontrolled.
- Supports horizontal/vertical orientation.
- Supports automatic and manual activation.
- Full keyboard navigation.
Installation
bash
pnpm dlx structyl add tabsAPI Reference
Tabs.Root
Contains the tab list and panels.
| Prop | Type | Default |
|---|---|---|
| value | stringControlled active tab. | — |
| defaultValue | stringInitial active tab. | — |
| onValueChange | (value: string) => voidCalled when the active tab changes. | — |
| orientation | 'horizontal' | 'vertical'Layout axis. | 'horizontal' |
| activationMode | 'automatic' | 'manual'Whether focusing a tab activates it. | 'automatic' |
| dir | 'ltr' | 'rtl'Reading direction. | — |
Tabs.List
The container of tab triggers.
| Prop | Type | Default |
|---|---|---|
| loop | booleanWhether arrow navigation wraps. | true |
Tabs.Trigger
Activates its associated panel.
| Prop | Type | Default |
|---|---|---|
| value | stringLinks the trigger to its content. | — |
| disabled | booleanDisable this tab. | false |
Tabs.Content
The panel for a given value.
| Prop | Type | Default |
|---|---|---|
| value | stringLinks the content to its trigger. | — |
| forceMount | booleanForce mounting for animation control. | — |
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. |