Nav
Takes you between the app's sections, marking the one you are on, as a row of links at the top and as a bar of tabs along the bottom of a phone.
Examples
Variants
--thumb pill with no edge, for a nav inside a grey track that already sets the pill apart.States
Usage
Use it when
- The app has 2 to 5 sections and you move between them on every visit.
- The current section must be visible at a glance from any page.
Use something else when
- The links switch views of one thing in place without changing the URL. Use Tabs or SegmentedControl instead.
- The link goes one level up to a list. Use BackLink instead.
- The row is a filter whose choices can be any number. Use ChipRow instead.
- The path is deeper than one level and needs every ancestor shown. Use BackLink for one level up and a plain row of links for deeper paths, the Breadcrumb row of coverage-gaps, instead.
Rules
General
Content
Avoid
Limits
Install
npx shadcn@latest add https://kaanarici.com/r/cobalt/nav.jsonimport { Nav, NavTabs, type NavItem, type NavProps, type NavTabsProps } from "@/components/cobalt/ui/nav"Related
- Sidebarthe app's navigation down the side, in groups, with a mark that slides to the current place.
- Sheetholds a task that is taller than a dialog, floating in from the side of the page.
- TextLinka link inside a sentence or beside a heading.
- SettingsLayoutthe sections of a settings page, in a list beside the open one.
