# Tabs
Use tabs to quickly switch between different views and pages.
```tsx
return (
Tab 1
Tab 2
Tab 3
Content for Tab 1
Content for Tab 2
Content for Tab 3
);
}
```
## Fluid Width
```tsx
return (
Tab 1
Tab 2
Tab 3
Content for Tab 1
Content for Tab 2
Content for Tab 3
);
}
```
## Vertical
```tsx
return (
Tab 1
Tab 2
Tab 3
Content for Tab 1
Content for Tab 2
Content for Tab 3
);
}
```
## Direction
```tsx
return (
Tab 1
Tab 2
Tab 3
Content for Tab 1
Content for Tab 2
Content for Tab 3
);
}
```
## API Reference
### TabsRoot
| Property | Type | Description |
| --- | --- | --- |
| `ids` | Partial<{ root: string; trigger: (value: string) => string; list: string; content: (value: string) => string; indicator: string; }>, undefined | The ids of the elements in the tabs. Useful for composition. |
| `translations` | IntlTranslations, undefined | Specifies the localized strings that identifies the accessibility elements and their states |
| `loopFocus` | boolean, undefined | Whether the keyboard navigation will loop from last tab to first, and vice versa. Default: true |
| `value` | string, null, undefined | The controlled selected tab value |
| `defaultValue` | string, null, undefined | The initial selected tab value when rendered. Use when you don't need to control the selected tab value. |
| `orientation` | "horizontal", "vertical", undefined | The orientation of the tabs. Can be `horizontal` or `vertical` - `horizontal`: only left and right arrow key navigation will work. - `vertical`: only up and down arrow key navigation will work. Default: "horizontal" |
| `activationMode` | "manual", "automatic", undefined | The activation mode of the tabs. Can be `manual` or `automatic` - `manual`: Tabs are activated when clicked or press `enter` key. - `automatic`: Tabs are activated when receiving focus Default: "automatic" |
| `onValueChange` | ((details: ValueChangeDetails) => void), undefined | Callback to be called when the selected/active tab changes |
| `onFocusChange` | ((details: FocusChangeDetails) => void), undefined | Callback to be called when the focused tab changes |
| `composite` | boolean, undefined | Whether the tab is composite |
| `deselectable` | boolean, undefined | Whether the active tab can be deselected when clicking on it. |
| `navigate` | ((details: NavigateDetails) => void), null, undefined | Function to navigate to the selected tab when clicking on it. Useful if tab triggers are anchor elements. |
| `dir` | "ltr", "rtl", undefined | The document's text/writing direction. Default: "ltr" |
| `getRootNode` | (() => ShadowRoot, Node, Document), undefined | A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron. |
| `element` | ((attributes: HTMLAttributes<"div">) => Element), undefined | Render the element yourself |
### TabsRootProvider
| Property | Type | Description |
| --- | --- | --- |
| `value`* | TabsApi | |
| `element` | ((attributes: HTMLAttributes<"div">) => Element), undefined | Render the element yourself |
### TabsRootContext
| Property | Type | Description |
| --- | --- | --- |
| `children`* | (tabs: TabsApi) => ReactNode | |
### TabsList
| Property | Type | Description |
| --- | --- | --- |
| `element` | ((attributes: HTMLAttributes<"div">) => Element), undefined | Render the element yourself |
### TabsTrigger
| Property | Type | Description |
| --- | --- | --- |
| `value`* | string | The value of the tab |
| `disabled` | boolean, undefined | Whether the tab is disabled |
| `element` | ((attributes: HTMLAttributes<"button">) => Element), undefined | Render the element yourself |
### TabsIndicator
| Property | Type | Description |
| --- | --- | --- |
| `element` | ((attributes: HTMLAttributes<"div">) => Element), undefined | Render the element yourself |
### TabsContent
| Property | Type | Description |
| --- | --- | --- |
| `value`* | string | The value of the tab |
| `element` | ((attributes: HTMLAttributes<"div">) => Element), undefined | Render the element yourself |