Skip to main content
A set of layered content sections that are displayed one at a time. Tabs organize related content into separate views, allowing users to switch between them without leaving the page.

Import

Basic Usage

Key Components

Tabs.Root

Groups the tabs and the corresponding panels. Renders a <div> element. Key Props:
  • value: any - The value of the currently active tab (controlled)
  • defaultValue: any - The default value for uncontrolled mode (default: 0)
  • onValueChange: (value: any, eventDetails: ChangeEventDetails) => void - Callback invoked when new value is being set
  • orientation: 'horizontal' | 'vertical' - The component orientation (default: 'horizontal')
State:
  • data-orientation: 'horizontal' | 'vertical' - The orientation of the tabs

Tabs.List

Contains the tab buttons. Renders a <div> element. Key Props:
  • loopFocus: boolean - Whether to loop keyboard focus (default: true)
  • activateOnFocus: boolean - Whether tabs are activated automatically when receiving focus (default: true)
State:
  • data-orientation: Reflects the parent orientation

Tabs.Tab

An individual interactive tab button. Renders a <button> element. Key Props:
  • value: any - The value of the tab (required)
  • disabled: boolean - Whether the tab is disabled
State:
  • data-active: Present when the tab is active
  • data-disabled: Present when the tab is disabled
  • data-orientation: Reflects the parent orientation

Tabs.Panel

The content panel associated with a tab. Renders a <div> element. Key Props:
  • value: any - The value of the panel (required, must match a tab’s value)
  • keepMounted: boolean - Whether to keep the panel mounted when inactive
State:
  • data-active: Present when the panel is active

Tabs.Indicator

A visual indicator that highlights the active tab. Renders a <span> element. State:
  • Automatically positioned using CSS custom properties
  • data-activation-direction: 'left' | 'right' | 'up' | 'down' | 'none' - The direction of tab activation

Features

  • Automatic and manual tab activation modes
  • Keyboard navigation with arrow keys
  • Horizontal and vertical orientations
  • Visual indicator for active tab
  • Support for disabled tabs
  • Controlled and uncontrolled modes
  • Accessible ARIA attributes
  • Loop focus option

Styling Example

Common Patterns

Controlled Tabs

Vertical Tabs

With Tab Indicator

Manual Activation

With Disabled Tabs

Keep Panels Mounted