Tab Nav
Navigation between the pages of an area that looks like tabs: a <nav> of react-aria links where the current page carries aria-current="page".
Overview
Unlike Tabs there are no panels — each item is a route — so use it for sub-pages and Tabs for in-page views.
- `variant`: matches the tab styles —
default(segmented onmuted, the current page raised) orline(underlined). - Current item: when
isCurrentis set or itshrefmatchesTabNav'scurrentHref(exactly, or withmatchPrefixalso on sub-paths). - `TabNavItem`: takes an icon before its label; `TabNavSeparator` divides groups.
- Overflow: when items don't fit, the strip scrolls sideways and keeps the current page in view.
Wrap the app in react-aria's RouterProvider for client routing.
Installation
CLI
Manual
- 1
Register the @fma-ds namespace in components.json (once)
- 2
Add the item
Files land in
components/fma-ds/tab-nav.tsx; npm and registry dependencies are installed along with them.
Dependencies
- npm
- class-variance-authority@^0.7.1cn@^0.5.0react-aria-components@^1.22.1
- Registry
- None