Components
Tabs

Tabs

The Tabs component is a powerful and flexible navigation tool for your applications. It offers various interaction modes, accessibility features, and the ability to display different contents based on the selected tab.

API reference docs for the component. Learn about the props, CSS, and other APIs of this exported module.

TabsProps

activationMode

'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

defaultValue

string

dir

'ltr' | 'rtl'

The document's text/writing direction.

getRootNode

() => ShadowRoot | Node | Document

A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.

id

string

The unique identifier of the machine.

ids

Partial<{ root: string trigger: string tablist: string content: string indicator: string }>

The ids of the elements in the tabs. Useful for composition.

loop

boolean

Whether the keyboard navigation will loop from last tab to first, and vice versa.

onFocusChange

(details: FocusChangeDetails) => void

Callback to be called when the focused tab changes

onValueChange

(details: ValueChangeDetails) => void

Callback to be called when the selected/active tab changes

orientation

'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.

translations

IntlTranslations

Specifies the localized strings that identifies the accessibility elements and their states

value

string

The selected tab id

TabsContext

clearValue

() => void

Clears the value of the tabs.

getContentProps

(props: ContentProps) => Dict<any>

getTriggerProps

(props: TriggerProps) => Dict<any>

getTriggerState

(props: TriggerProps) => TriggerState

Returns the state of the trigger with the given props

indicatorProps

Dict<any>

previousValues

string[]

The previous values of the tabs in sequence of selection.

rootProps

Dict<any>

setIndicatorRect

(value: string) => void

Sets the indicator rect to the tab with the given value

setValue

(value: string) => void

Sets the value of the tabs.

tablistProps

Dict<any>

focusedValue

string

The value of the tab that is currently focused.

value

string

The current value of the tabs.

TabContentProps

value

string

lazyMount

boolean

Whether to enable lazy mounting. Defaults to `false`.

onExitComplete

() => void

present

boolean

unmountOnExit

boolean

Whether to unmount on exit. Defaults to `false`.

TabTriggerProps

value

string

disabled

boolean