Tab nav
Links that look like tabs, for moving between pages. It is a navigation landmark rather than a tab list, because the page is about to change and nothing here promises a panel.
Reach for it
Switching between pages or URLs.
Not for
Panels inside one document. That is Tabs, and the roles differ.
Views of a list
Each item is a real link, so it can be opened in a new tab and the current one is marked with aria-current. The count is its own prop rather than part of the label, so it can restyle and change without rebuilding the text.
Current: /invoices/pending
API reference
TabNav
| Prop | Type | Default | Description |
|---|---|---|---|
| label* | string | - | Names the landmark, e.g. "Invoice views". |
| children* | ReactNode | - | |
| currentHref | string | - | The path being viewed. Compared against each item's href. |
TabNavItem
| Prop | Type | Default | Description |
|---|---|---|---|
| href* | string | - | |
| children* | ReactNode | - | |
| count | number | - | A count beside the label, for "To validate (3)". Its own prop rather than part of the label string. A number concatenated into a label cannot be styled, cannot change without rebuilding the string, and is announced as part of the tab's name. |
| render | ReactElement | - | An app's router link, rendered in place of the anchor. |