Installation
Add Component
Copy the code snippet below into you components folder.
Integrate Recipe
Integrate this recipe in to your Panda config.
Usage
Examples
Use the size prop to change the size of the tabs.
Variants
Use the variant prop to change the appearance of the tabs.
Orientation
Use the orientation prop to change the orientation of the tabs.
Lazy Loading
Optimize performance by using the lazyMount and unmountOnExit props to conditionally render tab content.
Fitted
Use the fitted prop to make the tabs fit the width of the container.
Props
Root
| Prop | Default | Type | 
|---|---|---|
| size | 'md' | 'xs' | 'sm' | 'md' | 'lg' | 
| variant | 'line' | 'line' | 'subtle' | 'enclosed' | 
| activationMode | \automatic\ | 'manual' | 'automatic'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 | 
| lazyMount | false | booleanWhether to enable lazy mounting | 
| loopFocus | true | booleanWhether the keyboard navigation will loop from last tab to first, and vice versa. | 
| orientation | \horizontal\ | 'horizontal' | 'vertical'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. | 
| unmountOnExit | false | booleanWhether to unmount on exit. | 
| fitted | boolean | |
| asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. | |
| composite | booleanWhether the tab is composite | |
| defaultValue | stringThe initial selected tab value when rendered. Use when you don't need to control the selected tab value. | |
| deselectable | booleanWhether the active tab can be deselected when clicking on it. | |
| id | stringThe unique identifier of the machine. | |
| ids | Partial<{ root: string; trigger: string; list: string; content: string; indicator: string }>The ids of the elements in the tabs. Useful for composition. | |
| navigate | (details: NavigateDetails) => voidFunction to navigate to the selected tab when clicking on it. Useful if tab triggers are anchor elements. | |
| onFocusChange | (details: FocusChangeDetails) => voidCallback to be called when the focused tab changes | |
| onValueChange | (details: ValueChangeDetails) => voidCallback to be called when the selected/active tab changes | |
| translations | IntlTranslationsSpecifies the localized strings that identifies the accessibility elements and their states | |
| value | stringThe controlled selected tab value | 
TabContent
| Prop | Default | Type | 
|---|---|---|
| value* | stringThe value of the tab | |
| asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. | 
TabTrigger
| Prop | Default | Type | 
|---|---|---|
| value* | stringThe value of the tab | |
| asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. | |
| disabled | booleanWhether the tab is disabled |