Tabs

Accessible React tabs built on Radix with a roving tablist, icons, full-width and flush styles, overflow handling, and Arabic labels. Arrow keys move between tabs.

Each TabsTrigger pairs with a TabsContent by value; defaultValue picks the first panel and arrow keys move between tabs.

When to use

Use Tabs to split one page into related panels that share context, such as a request's details, documents, and history. Keep tab labels to one or two words and put the default panel first.

For switching views of the same data, use ContentSwitcher. For long content that all needs to be visible, use headings and Accordion.

Examples

Basic tabs

With leading icons

Full-width

Arabic labels

Props

Props declared by Tabs. Native attributes of the underlying element pass through.

<Tabs>

PropTypeDefaultDescription
size"sm" | "md" | "lg"
asChildboolean
valuestringThe value for the selected tab, if controlled
defaultValuestringThe value of the tab to select by default, if uncontrolled
onValueChange(value: string) => voidA function called when a new tab is selected
orientation"vertical" | "horizontal"horizontalThe orientation the tabs are layed out. Mainly so arrow navigation is done accordingly (left & right vs. up & down)
dirDirectionThe direction of navigation between toolbar items.
activationMode"manual" | "automatic"automaticWhether a tab is activated automatically or manually.

<TabsList>

PropTypeDefaultDescription
fullWidthboolean
flushboolean
overflowbooleanCollapse tabs that don't fit into a trailing "More" overflow menu (SDGA "More Tab"). Horizontal lists only - the list fills its container's inline size and pushes the overflow trigger to the trailing edge.
moreLabelstringAccessible name for the overflow trigger when overflow is set.
asChildboolean
loopboolean

<TabsTrigger>

PropTypeDefaultDescription
startIconreact.ReactNodeLeading icon, rendered before the label in a decorative (aria-hidden) wrapper. Ignored when asChild is set - compose icons inside your own element in that mode.
endIconreact.ReactNodeTrailing icon (e.g. a count/badge glyph). Same rules as startIcon.
asChildboolean
valuerequiredstring

<TabsContent>

PropTypeDefaultDescription
asChildboolean
valuerequiredstring
forceMounttrueUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.

Accessibility

Tabs follow the tabs pattern: role="tablist", role="tab", and role="tabpanel" with the selected tab exposed. The arrow keys move focus between tabs, Home and End jump to the ends, and the arrow keys follow the reading direction in RTL.

Give the list an aria-label. Overflowing tabs move into a "More" menu whose label you control with moreLabel.