items: [{ key, label, content?, disabled? }]. Controlled with value / onChange, or uncontrolled with defaultValue. Arrow, Home and End keys move between tabs. When there are more tabs than fit, scroll buttons appear at both ends (disabled at the ends) and the active tab is kept in view; scrollButtons="never" turns them off.
Welcome to the lair.
Props
Tabs
itemsTabItem[]Tabs;
contentis shown in the panel when active. See the TabItem table below.valuestringActive key (controlled).
defaultValuestringDefault:first keyInitially active key (uncontrolled).
onChange(key: string) => voidCalled when the active tab changes.
scrollButtons'auto' | 'never'Default:'auto'Show scroll buttons at both ends when the tabs do not fit; never hides them.
classNamestringDefault:''Extra classes for the root element.
| Prop | Type | Default | Description |
|---|---|---|---|
items | TabItem[] | – | Tabs; content is shown in the panel when active. See the TabItem table below. |
value | string | – | Active key (controlled). |
defaultValue | string | first key | Initially active key (uncontrolled). |
onChange | (key: string) => void | – | Called when the active tab changes. |
scrollButtons | 'auto' | 'never' | 'auto' | Show scroll buttons at both ends when the tabs do not fit; never hides them. |
className | string | '' | Extra classes for the root element. |
TabItem
keystringUnique key of the tab.
labelReactNodeText of the tab button.
contentReactNodeShown in the panel while the tab is active.
disabledbooleanDefault:falseDim the tab and ignore it.
| Prop | Type | Default | Description |
|---|---|---|---|
key | string | – | Unique key of the tab. |
label | ReactNode | – | Text of the tab button. |
content | ReactNode | – | Shown in the panel while the tab is active. |
disabled | boolean | false | Dim the tab and ignore it. |