Tabs
Tabbed interface with keyboard navigation.
Installation
Usage
Examples
Disabled tab
Disabled tabs are skipped by clicks and keyboard navigation.
Custom tab content
Tabs accept rich children like count badges.
Vertical
Stack the list beside the panels with a vertical orientation.
API reference
Tabs
| Prop | Type | Default |
|---|---|---|
valueControlled active tab. Use with onValueChange. | string | - |
defaultValueInitially active tab when uncontrolled. | string | - |
onValueChangeCalled when the active tab changes. | (value: string) => void | - |
orientationLayout direction. Vertical uses up/down arrow keys. | "horizontal" | "vertical" | "horizontal" |
TabsList
| Prop | Type | Default |
|---|---|---|
renderPolymorphic render prop. | ReactElement | ((props) => ReactNode) | - |
classNameAdditional classes merged with the default list styles. | string | - |
TabsTab
| Prop | Type | Default |
|---|---|---|
valueRequiredUnique tab identifier. Shows the matching panel. | string | - |
disabledDisable the tab. Skipped by keyboard navigation. | boolean | false |
renderPolymorphic render prop. Accepts custom tab content like count badges. | ReactElement | ((props) => ReactNode) | - |
classNameAdditional classes merged with the default tab styles. | string | - |
TabsPanel
| Prop | Type | Default |
|---|---|---|
valueRequiredRenders when the tab with the same value is active. | string | - |
keepMountedKeep the panel in the DOM while inactive. | boolean | false |
renderPolymorphic render prop. | ReactElement | ((props) => ReactNode) | - |
classNameAdditional classes merged with the default panel styles. | string | - |