Skip to content

Navbar ​

The Navbar component displays brand identity, main navigation, and toolbar actions at the top of the page.

TIP

⚠️ Due to limitations of the whyframe and vitepress demo framework, the interactive demos below may show the mobile responsive layout (hamburger button visible). Click the "Demo" link in the top navigation bar to see the full desktop effect.

Basic Usage ​

Use variant to control the background style and theme for light/dark mode.

vue
<TNavbar variant="transparent">
  <template #brand>
    <TNavbarBrand href="#">My App</TNavbarBrand>
  </template>
  <TNavMenu :items="menuItems" />
  <template #actions>
    <a class="nav-link px-0" href="#"><IconMoon class="icon icon-1" /></a>
  </template>
</TNavbar>

Dark Theme ​

Set theme="dark" to enable dark mode.

vue
<TNavbar theme="dark">
  <template #brand>
    <TNavbarBrand href="#">Dashboard</TNavbarBrand>
  </template>
  <TNavMenu :items="menuItems" />
</TNavbar>

Primary Color ​

Use variant="primary" with dark theme for a colored navbar.

vue
<TNavbar variant="primary" theme="dark">
  ...
</TNavbar>

Data-Driven Menu ​

Pass a menu configuration array via items prop to auto-render navigation links and dropdowns.

vue
<TNavMenu :items="[
  { label: 'Home', icon: IconStar, href: '#', active: true },
  { label: 'Projects', href: '#', badge: '3' },
  { label: 'More', children: [
    { label: 'Sub item', href: '#' },
  ]},
]" />

API ​

TNavbar Props ​

PropDescriptionTypeDefault
variantBackground variant'light' | 'dark' | 'transparent' | 'primary''light'
stickyStick to top on scrollbooleanfalse
themeLight/dark theme'light' | 'dark'—
expandCollapse breakpoint'sm' | 'md' | 'lg' | 'xl''md'
noPrintHide when printingbooleantrue

TNavbar Slots ​

SlotDescription
brandBrand/Logo area
actionsRight-side toolbar
defaultMain navigation menu area
togglerCustom mobile toggle button

TNavMenu Props ​

PropDescriptionTypeDefault
itemsMenu configurationNavMenuItem[][]
fillFill full widthbooleanfalse
PropertyTypeDescription
labelstringDisplay text
iconIconIcon component
badgestring | { text, color }Badge
hrefstringLink URL
activebooleanActive state
disabledbooleanDisabled state
dividerbooleanRender as divider
childrenNavMenuItem[]Sub menu items

TNavbarBrand Props ​

PropDescriptionTypeDefault
logoLogo image URLstring—
hrefLink URLstring'.'
logoWidthImage widthnumber110
logoHeightImage heightnumber32