Components

Navbar

Build a top navigation bar with brand, links, avatar, and a sidebar toggle.

UiNavbar is a composable top navigation bar. Assemble it from brand, title, nav, link, avatar, and toggle sub-components. From 992px the links live in UiNavbarCollapse; below that the collapse is hidden and UiNavbarMobileMenu shows instead, usually with the avatar. Pair it with UiNavigationBar for mobile links.

Build a navbar

Nav groups go inside UiNavbarCollapse, which is what lays them out. UiNavbarLink renders its own list item; wrap anything else, such as the avatar, in UiNavbarItem.

<script setup lang="ts">
import { NuxtLink } from '#components'
</script>

<template>
  <UiNavbar sticky aria-label="Top navigation">
    <UiNavbarTitle title="Dashboard">
      <template #brand>
        <UiNavbarBrand :as="NuxtLink" to="/" text="Acme" logo="/logo.svg" />
      </template>
    </UiNavbarTitle>

    <UiNavbarMobileMenu>
      <UiNavbarAvatar src="/me.jpg" alt="Account" size="sm" @click="openMenu" />
    </UiNavbarMobileMenu>

    <UiNavbarCollapse>
      <UiNavbarNav position="start">
        <UiNavbarLink :as="NuxtLink" to="/docs" text="Docs" />
        <UiNavbarLink :as="NuxtLink" to="/pricing" text="Pricing" />
      </UiNavbarNav>

      <UiNavbarNav position="end">
        <UiNavbarItem>
          <UiNavbarAvatar src="/me.jpg" alt="Account" @click="openMenu" />
        </UiNavbarItem>
      </UiNavbarNav>
    </UiNavbarCollapse>
  </UiNavbar>
</template>

The current-page link is highlighted from the router's exact-active class, so give nav links a router component through as. active only sets aria-current="page". The UiNavbarTitle text fades in once a sticky navbar is stuck to the top.

Toggle a sidebar

UiNavbarToggle drives UiSidebar. It is hidden below 1024px unless show-toggle-button is set, and collapsed follows the rail, so one boolean usually drives both the rail and the mobile drawer:

<template>
  <UiNavbarToggle show-toggle-button :collapsed="collapsed" controls="main-sidebar" @toggle="collapsed = !collapsed" />
</template>

UiNavbar props

PropTypeDefaultDescription
stickybooleanfalseSticky positioning.
fluidbooleanfalseFluid (full-width) container.
ariaLabelstring'Main navigation'Landmark name. Give it a distinct name when a UiSidebar (same default) is on the page.
customClassstring | string[] | Record<string, boolean> | null—Classes on nav.navbar, such as nav-island or nav-transparent.

Sub-components

ComponentKey props
UiNavbarBrandlogo, initials (shown without a logo), text, as, to / href; #link slot replaces the link
UiNavbarTitletitle; #brand slot before the title, #title slot after it
UiNavbarCollapseDesktop region, hidden below 992px. Default slot for UiNavbarNav groups, or #start / #end slots that render the groups for you
UiNavbarNavposition: 'start' sits after the brand, 'end' is pushed to the far edge. Only styled inside UiNavbarCollapse
UiNavbarItemcustomClass; wraps custom content such as a search field or the avatar (UiNavbarLink renders its own item)
UiNavbarLinktext, to / href, as, active, disabled; #icon slot before the text
UiNavbarAvatarsrc, alt, size ('sm' / 'navbar'); emits click
UiNavbarMobileMenuShown only below 992px; customClass
UiNavbarTogglecollapsed, controls, collapseText, expandText, showToggleButton; emits toggle

CSS variables

Set these on :root, or on any wrapper to restyle only the navbars inside it. Variants such as nav-island and nav-transparent keep their own background and radius. Hover and pressed backgrounds come from the shared state layer.

:root {
  --cffy-navbar-bg-color: var(--cffy-surface-container-low);
  --cffy-navbar-link-active-bg-color: var(--cffy-primary-a10);
  --cffy-navbar-link-active-color: var(--cffy-on-primary);
}
VariableDefaultControls
--cffy-navbar-bg-color--cffy-backgroundBackground
--cffy-navbar-color--cffy-on-backgroundBrand and title text color
--cffy-navbar-shadownoneShadow
--cffy-navbar-radius--cffy-radius-noneCorner radius (links follow it)
--cffy-navbar-padding-inline / --cffy-navbar-padding-block0 / --cffy-space-8Inner padding
--cffy-navbar-margin-block-endthe block paddingSpace below the navbar
--cffy-navbar-min-height4.25remMinimum height
--cffy-navbar-easing / --cffy-navbar-duration--cffy-ease-emphasized / --cffy-duration-600Background and collapse transitions
--cffy-navbar-brand-font-size / --cffy-navbar-brand-font-weight--cffy-fs-sm / --cffy-fw-800Brand text
--cffy-navbar-brand-size50pxMaximum logo width and height
--cffy-navbar-brand-hover-color--cffy-primary-a20Brand color on hover
--cffy-navbar-title-font-size / --cffy-navbar-title-font-weight--cffy-fs-sm / --cffy-fw-600Page title
--cffy-navbar-link-color--cffy-muted-a10Link text
--cffy-navbar-link-hover-color--cffy-primary-a10Hovered link text
--cffy-navbar-link-active-color / --cffy-navbar-link-active-bg-color--cffy-primary-a10 / --cffy-surface-containerCurrent-page link (its border follows the background)
--cffy-navbar-link-font-size / --cffy-navbar-link-font-weight--cffy-fs-xs / --cffy-fw-600Link text
--cffy-navbar-link-radiusnavbar radius + .5remLink corners
--cffy-navbar-link-padding-inline / --cffy-navbar-link-padding-block0 (--cffy-space-8 from 992px) / --cffy-space-8Link padding
Copyright © 2026