Link-based tab navigation for page-level routing. Unlike Tabs, TabNav uses anchor elements so each tab corresponds to a URL.
import TabNav from "@radui/ui/TabNav"- Tabs that are links, so each tab is a URL and the browser back button works
- Arrow keys move between links; the active one is the group's tab stop
- active marks the current page; use asChild to render your router's Link
- Horizontal or vertical, right-to-left aware
Import all parts of the component and piece them together.
The root TabNav container. Renders a <nav> landmark.
| Prop | Type | Default |
|---|---|---|
value | string | — |
defaultValue | string | — |
onValueChange | (value: string) => void | — |
orientation | 'horizontal' | 'vertical' | 'horizontal' |
loop | boolean | true |
aria-label | string | — |
className | string | "" |
A tab link that navigates to a URL.
| Prop | Type | Default |
|---|---|---|
href* | string | — |
value | string | — |
active | boolean | — |
disabled | boolean | false |
asChild | boolean | false |
className | string | "" |
| Shortcut | Description |
|---|---|
| Tab | Moves focus into or out of the navigation landmark. When a current link is set, focus enters on that link. |
| ArrowRight | Moves focus to the next enabled link in horizontal orientation. In right-to-left direction, moves to the previous enabled link. |
| ArrowLeft | Moves focus to the previous enabled link in horizontal orientation. In right-to-left direction, moves to the next enabled link. |
| ArrowDown | Moves focus to the next enabled link in vertical orientation. |
| ArrowUp | Moves focus to the previous enabled link in vertical orientation. |
| Home | Moves focus to the first enabled link. |
| End | Moves focus to the last enabled link. |
| Enter | Activates native anchors or button-like children rendered with asChild. The merged click handler updates the selected value when a value is provided. |
| Space | Activates custom children that render a button-like element with asChild; anchors keep native browser link behavior. |
| Reference | What Rad UI follows |
|---|---|
| Navigation landmark | Root renders a native nav landmark. Provide aria-label or aria-labelledby when the page has more than one navigation region. |
| Link pattern | Links use native anchor semantics and expose the current route with aria-current="page". Without asChild, disabled links expose aria-disabled and remove href; with asChild, the child controls disabled semantics. |