Tabs

Tabs with controlled and uncontrolled modes, arrow-key navigation and the WAI-ARIA tabs pattern.

Props

PropTypeDefaultDescription
valuestring—Controlled selected value
defaultValuestring—Initial value when uncontrolled
onValueChange(value: string) => void—Called on every change, controlled or not
orientation'horizontal' | 'vertical''horizontal'Layout direction: horizontal / vertical
variant'segmented' | 'underline''segmented'Appearance: segmented (pill) or underline (text with an underline); the indicator animates
Tabs.ListHTMLAttributes<HTMLDivElement>—The tab strip that handles arrow-key navigation
Tabs.Trigger{ value: string } & ButtonHTMLAttributes—A single tab; its value maps to a panel
Tabs.Panel{ value: string } & HTMLAttributes—Panel kept in the DOM, only the inactive ones are hidden
...restHTMLAttributes—Remaining props are forwarded to the native div