File: tab-nav.md | Updated: 11/15/2025
ThemesThemes PrimitivesPrimitives IconsIcons ColorsColors
Getting started Styling Layout Releases Resources
Overview Color Dark mode Typography Spacing Breakpoints Radius Shadows Cursors
Box Flex Grid Container Section
Text Heading Blockquote Code Em Kbd Link Quote Strong
Alert Dialog Aspect Ratio Avatar Badge Button Callout Card Checkbox Checkbox Group Checkbox Cards Context Menu Data List Dialog Dropdown Menu Hover Card Icon Button Inset Popover Progress Radio Radio Group Radio Cards Scroll Area Segmented Control Select Separator Skeleton Slider Spinner Switch Table Tabs Tab Nav Text Area Text Field Tooltip
Accessible Icon Portal Reset Slot Theme Visually Hidden
Components
Navigation menu with links styled as tabs.
View source Report an issue View in Playground
<TabNav.Root>
<TabNav.Link href="#" active>
Account
</TabNav.Link>
<TabNav.Link href="#">Documents</TabNav.Link>
<TabNav.Link href="#">Settings</TabNav.Link>
</TabNav.Root>
This component is based on the Navigation Menu primitive and supports common margin props .
Contains the navigation menu links.
| Prop | Type | Default |
| --- | --- | --- |
| size | Responsive<"1" \| "2"> | "2" |
| wrap | Responsive<"nowrap" \| "wrap" \| "wrap-reverse"> | No default value |
| justify | Responsive<"start" \| "center" \| "end"> | No default value |
| color<br><br>Prop description | enum<br><br>See full type | No default value |
| highContrast<br><br>Prop description | boolean | No default value |
An individual navigation menu link.
| Prop | Type | Default |
| --- | --- | --- |
| asChild<br><br>Prop description | boolean | No default value |
| active | boolean | false |
Use the size prop to control the size of the tabs.
<Flex direction="column" gap="4" pb="2">
<TabNav.Root size="1">
<TabNav.Link href="#" active>
Account
</TabNav.Link>
<TabNav.Link href="#">Documents</TabNav.Link>
<TabNav.Link href="#">Settings</TabNav.Link>
</TabNav.Root>
<TabNav.Root size="2">
<TabNav.Link href="#" active>
Account
</TabNav.Link>
<TabNav.Link href="#">Documents</TabNav.Link>
<TabNav.Link href="#">Settings</TabNav.Link>
</TabNav.Root>
</Flex>
Use the color prop to assign a specific color
to the tab list.
<Flex direction="column" gap="4" pb="2">
<TabNav.Root color="indigo">
<TabNav.Link href="#" active>
Account
</TabNav.Link>
<TabNav.Link href="#">Documents</TabNav.Link>
<TabNav.Link href="#">Settings</TabNav.Link>
</TabNav.Root>
<TabNav.Root color="cyan">
<TabNav.Link href="#" active>
Account
</TabNav.Link>
<TabNav.Link href="#">Documents</TabNav.Link>
<TabNav.Link href="#">Settings</TabNav.Link>
</TabNav.Root>
<TabNav.Root color="orange">
<TabNav.Link href="#" active>
Account
</TabNav.Link>
<TabNav.Link href="#">Documents</TabNav.Link>
<TabNav.Link href="#">Settings</TabNav.Link>
</TabNav.Root>
<TabNav.Root color="crimson">
<TabNav.Link href="#" active>
Account
</TabNav.Link>
<TabNav.Link href="#">Documents</TabNav.Link>
<TabNav.Link href="#">Settings</TabNav.Link>
</TabNav.Root>
</Flex>
Use the highContrast prop to increase color contrast with the background.
<Flex direction="column" gap="4" pb="2">
<TabNav.Root color="gray">
<TabNav.Link href="#" active>
Account
</TabNav.Link>
<TabNav.Link href="#">Documents</TabNav.Link>
<TabNav.Link href="#">Settings</TabNav.Link>
</TabNav.Root>
<TabNav.Root color="gray" highContrast>
<TabNav.Link href="#" active>
Account
</TabNav.Link>
<TabNav.Link href="#">Documents</TabNav.Link>
<TabNav.Link href="#">Settings</TabNav.Link>
</TabNav.Root>
</Flex>
Use the asChild prop to compose TabNav.Link with your app’s router link component.
<TabNav.Root>
<TabNav.Link asChild active={pathname === "/account"}>
<NextLink href="/account">Account</NextLink>
</TabNav.Link>
<TabNav.Link asChild active={pathname === "/documents"}>
<NextLink href="/documents">Documents</NextLink>
</TabNav.Link>
<TabNav.Link asChild active={pathname === "/settings"}>
<NextLink href="/settings">Settings</NextLink>
</TabNav.Link>
</TabNav.Root>
PreviousTabs
NextText Area