Top navigation bar with a logo-agnostic brand, Button-backed links, a right-aligned actions cluster, and a responsive mobile menu.
Description
Navbar is a compound top bar: a logo-agnostic NavbarBrand, a NavbarContent link group, a right-aligned NavbarActions cluster, and — below md — a NavbarMenu panel toggled by an animated NavbarMenuToggle. NavbarLink renders a real Button under the hood, so links inherit every button variant, state, and focus style instead of a parallel set of styles.
Reach for it as the persistent chrome at the top of a marketing site or app: brand on the left, primary links in the middle, and auth or account controls on the right. "Signed-in" versus "guest" is not a prop — the brand and links are identical, so the two views differ only in what you put in NavbarActions (auth buttons for a guest; notification, search, and an account button for a signed-in user).
For hierarchical path navigation use Breadcrumb; for switching sections within a page use Tabs or TabMenu. The "Solutions" and account chevrons are decorative — wire your own DropdownMenu when a link should open a menu.
Navbar is a Create UI Pro component. With a Pro seat, npx @create-ui/cli add navbar installs it, and the previews below are marked with a Pro badge. Its vertical NavbarSeparator is built on the Pro Separator (its direction="vertical" mode), which add navbar pulls in automatically.
Installation
Anatomy
Navbar owns the mobile-menu open state and hands it to NavbarMenuToggle / NavbarMenu through context, so it is a client component. It also wires the menu's dismissal for you: Escape and an outside pointer press close it, and focus returns to the toggle. Everything to the left of NavbarActions stays the same between the guest and signed-in views.
Usage
The brand ships nothing for you: pass your own logo as NavbarBrand children, an inline <svg> (best for a logo: crisp, token-colored, no request) or an <img src>. The divider between the brand and the links is NavbarSeparator — the Pro Separator in its direction="vertical" mode, a hairline that stretches to the bar height.
Examples
Active
Set active on the current page's NavbarLink (or NavbarMenuItem). It renders a soft bg-weak background and sets aria-current="page". Mark at most one item active.
Bordered
bordered adds a bottom hairline (off by default, since the base design has none). Use it when the bar sits directly against page content and needs a defined edge.
Signed In
There is no guest / account prop. Swap the NavbarActions children for an account cluster — icon Buttons for notification and search plus a Button wrapping an Avatar — and everything to the left stays identical.
Sticky
position="sticky" pins the bar to the top of its scroll container (static is the default). Wrap it in your own scroll area to see it stay in place.
Responsive
The bar is full-width; responsiveness is composition-level. Show every link while the bar is wide enough, fold the overflow links into a ··· trigger once they no longer fit, and below md hide NavbarContent and secondary actions, reveal NavbarMenuToggle, and list the links as NavbarMenuItems inside NavbarMenu. Use the Desktop / Tablet / Mobile switcher above the preview (or resize the window) to move the bar through desktop → tablet → mobile.
Accessibility
NavbarContent renders as a <nav aria-label="Main"> landmark. Each NavbarLink is a real <a> (or the element you pass via asChild), so it is a normal tab stop with normal link semantics; the active link gets aria-current="page".
ARIA notes:
NavbarContentis the<nav aria-label="Main">group; pass your ownaria-labelif a page has more than one nav landmark.- The active
NavbarLink/NavbarMenuItemsetsaria-current="page". Mark at most one item active. NavbarMenuTogglesetsaria-expanded,aria-controls(pointing at theNavbarMenuit opens), and anaria-labelthat flips between "Open menu" and "Close menu"; its animated bars arearia-hidden.- The open
NavbarMenudismisses onEscape(focus returns to the toggle) and on a pointer press outside the bar; selecting aNavbarMenuItemalso closes it. Its open animation is gated behindmotion-safe, so it honorsprefers-reduced-motion. - Icon-only actions (notification, search, the
···overflow) need anaria-label. A decorative brand SVG should bearia-hidden, orrole="img"with anaria-labelwhen it stands in for the brand name. - The "Solutions" and account chevrons are visual only. If a link opens a menu, wrap it in a
DropdownMenuso the real menu semantics and keyboard model come along.
Styling
Tailwind override: pass className to merge Tailwind classes with the component's classes (via cn()) on any part:
The bar spans full width with no built-in max-width cap, so constrain it with your own wrapper or a className.
Data slots and attributes: the component sets these for CSS targeting.
data-slot="navbar"on the root<header>,data-slot="navbar-inner"on the inner flex row.data-slot="navbar-brand"on the brand,data-slot="navbar-content"on the<nav>,data-slot="navbar-actions"on the actions cluster.data-slot="navbar-link"on each link,data-slot="navbar-menu-toggle"on the hamburger,data-slot="navbar-menu"on the mobile panel,data-slot="navbar-menu-item"on each menu link.data-borderedon the root whenborderedis set;data-position="static" | "sticky"on the root.data-state="open" | "closed"on the root, the toggle, and the menu, reflecting the mobile-menu state.data-activeon the active link / menu item.
Target the open menu in CSS:
Related Components
- TabMenu: use this for switching between sections inside a page, not for site-level navigation.
- Tabs: use this when each option swaps a content panel within the same surface.
- Breadcrumb: use this for hierarchical path navigation.
- DropdownMenu: attach one to a
NavbarLinkor account button when a link should open a menu. - Separator: the primitive
NavbarSeparatorwraps indirection="vertical"; use it directly for the horizontal divider inside aNavbarMenu. - Button: the primitive
NavbarLinkandNavbarActionscompose; use it directly for auth and account controls.
API Reference
Navbar
The root <header>. Owns the mobile-menu open state and provides the context that NavbarMenuToggle, NavbarMenu, and NavbarMenuItem read. Extends React.ComponentProps<"header">.
Props
Variants
NavbarBrand
Left-aligned brand slot. Logo-agnostic — pass your own inline <svg> or <img> (plus an optional version Badge) as children. Extends React.ComponentProps<"div">.
Props
NavbarSeparator
A vertical hairline divider that stretches to the bar height, built on the Pro Separator in direction="vertical" mode (so role="separator" / aria-orientation="vertical"). Sits between NavbarBrand and NavbarContent. Extends React.ComponentProps<"div">.
Props
NavbarContent
The primary link group. Renders <nav aria-label="Main">. Extends React.ComponentProps<"nav">.
Props
NavbarLink
A nav link that renders a Button under the hood, so it inherits button styling. Extends React.ComponentProps<"a">.
Props
NavbarActions
Right-aligned actions cluster. Owns the single ml-auto, so it always sits hard right no matter how many links precede it. Extends React.ComponentProps<"div">.
Props
NavbarMenuToggle
The mobile hamburger button (an animated ☰ ↔ ✕). Reads the navbar context to toggle the menu. Extends the Button props; typically only className (e.g. md:hidden) is passed.
Props
NavbarMenu
The mobile menu panel. Renders below the bar and only while open and below md. Reads the navbar context. Extends React.ComponentProps<"div">.
Props
NavbarMenuItem
A full-width link inside NavbarMenu that closes the menu on click. Extends React.ComponentProps<"a">.
Props
useNavbar
Hook that returns the navbar context: { open, setOpen, toggle }. Call it inside a Navbar to drive the mobile menu from a custom control; it throws if used outside a Navbar.