
Tabbed interface with accessible panel switching.
npx shadcn@latest add https://ui.edbn.me/r/tabs.jsonGroups all parts of the tabs component. Renders a div element.
defaultValueanyInitially active tab
valueanyControlled active tab
onValueChangefunctionCalled when active tab changes
orientation'horizontal' | 'vertical''horizontal'Tabs orientation
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Attribute | Description |
|---|---|
| data-orientation | Tabs orientation |
| data-activation-direction | Direction of tab activation (left, right, up, down, none) |
Contains the tab triggers. Renders a div element (role=tablist).
activateOnFocusbooleantrueActivate tab on focus
loopFocusbooleantrueLoop keyboard focus
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Attribute | Description |
|---|---|
| data-orientation | Tabs orientation |
A tab trigger button. Renders a button element.
valueanyRequiredTab identifier
disabledbooleanfalseDisable tab
nativeButtonbooleantrueRender as native button
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Attribute | Description |
|---|---|
| data-selected | Present when tab is active |
| data-disabled | Present when tab is disabled |
An indicator that highlights the active tab. Renders a span element.
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Variable | Description |
|---|---|
| --active-tab-top | Top position of active tab |
| --active-tab-left | Left position of active tab |
| --active-tab-width | Width of active tab |
| --active-tab-height | Height of active tab |
The content panel for a tab. Renders a div element.
valueanyRequiredTab identifier
keepMountedbooleanfalseKeep in DOM when inactive
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Attribute | Description |
|---|---|
| data-hidden | Present when panel is hidden |