Components
Tabs
Tabbed navigation for switching between content panels. Keyboard navigable, WAI-ARIA compliant.
Import
Usage
Controlled
Props
Tabs
| Prop | Type | Default | Description |
|---|---|---|---|
defaultValue | string | — | Initial active tab (uncontrolled) |
value | string | — | Active tab (controlled) |
onValueChange | (value: string) => void | — | Called when tab changes |
variant | 'line' | 'pills' | 'enclosed' | 'line' | Visual style |
className | string | — | Additional CSS classes |
Tab
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Tab identifier |
disabled | boolean | false | Disable this tab |
children | React.ReactNode | — | Tab label |
TabPanel
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Associated tab value |
children | React.ReactNode | — | Panel content |
Disabled tabs
Accessibility
TabListhasrole="tablist"- Each
Tabhasrole="tab"witharia-selectedandaria-controls - Each
TabPanelhasrole="tabpanel"witharia-labelledby - Arrow keys navigate between tabs
- Home/End jump to first/last tab
- Inactive panels are hidden with
aria-hiddenanddisplay: none
Related
- Accordion — collapsible sections (alternative to tabs for longer content)