navigation menu

A collection of links for navigating websites.

PreviousNext
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { NgIcon, provideIcons } from '@ng-icons/core';
import { lucideCircleAlert, lucideCircleCheck, lucideCircleDashed } from '@ng-icons/lucide';

import { navigationMenuTriggerVariants, ZardNavigationMenuImports } from '@/shared/components/navigation-menu';

interface ComponentLink {
  title: string;
  href: string;
  description: string;
}

@Component({
  selector: 'z-demo-navigation-menu-preview',
  imports: [ZardNavigationMenuImports, NgIcon],
  template: `
    <nav aria-label="Main" class="contents">
      <z-navigation-menu>
        <ul z-navigation-menu-list>
          <li z-navigation-menu-item>
            <button type="button" z-navigation-menu-trigger [zNavigationMenuTriggerFor]="gettingStarted">
              Getting started
            </button>

            <ng-template #gettingStarted>
              <div z-navigation-menu-content>
                <ul class="w-96">
                  <li>
                    <a z-navigation-menu-link href="#">
                      <div class="flex flex-col gap-1 text-sm">
                        <div class="leading-none font-medium">Introduction</div>
                        <div class="text-muted-foreground line-clamp-2">
                          Re-usable components built with Tailwind CSS.
                        </div>
                      </div>
                    </a>
                  </li>
                  <li>
                    <a z-navigation-menu-link href="#">
                      <div class="flex flex-col gap-1 text-sm">
                        <div class="leading-none font-medium">Installation</div>
                        <div class="text-muted-foreground line-clamp-2">
                          How to install dependencies and structure your app.
                        </div>
                      </div>
                    </a>
                  </li>
                  <li>
                    <a z-navigation-menu-link href="#">
                      <div class="flex flex-col gap-1 text-sm">
                        <div class="leading-none font-medium">Typography</div>
                        <div class="text-muted-foreground line-clamp-2">
                          Styles for headings, paragraphs, lists...etc
                        </div>
                      </div>
                    </a>
                  </li>
                </ul>
              </div>
            </ng-template>
          </li>

          <li z-navigation-menu-item class="hidden md:flex">
            <button type="button" z-navigation-menu-trigger [zNavigationMenuTriggerFor]="componentsMenu">
              Components
            </button>

            <ng-template #componentsMenu>
              <div z-navigation-menu-content>
                <ul class="grid w-[400px] gap-2 md:w-[500px] md:grid-cols-2 lg:w-[600px]">
                  @for (component of components; track component.title) {
                    <li>
                      <a z-navigation-menu-link href="#">
                        <div class="flex flex-col gap-1 text-sm">
                          <div class="leading-none font-medium">{{ component.title }}</div>
                          <div class="text-muted-foreground line-clamp-2">{{ component.description }}</div>
                        </div>
                      </a>
                    </li>
                  }
                </ul>
              </div>
            </ng-template>
          </li>

          <li z-navigation-menu-item>
            <button type="button" z-navigation-menu-trigger [zNavigationMenuTriggerFor]="withIcon">With Icon</button>

            <ng-template #withIcon>
              <div z-navigation-menu-content>
                <ul class="grid w-[200px]">
                  <li>
                    <a z-navigation-menu-link href="#" class="flex-row items-center gap-2">
                      <ng-icon name="lucideCircleAlert" />
                      Backlog
                    </a>
                    <a z-navigation-menu-link href="#" class="flex-row items-center gap-2">
                      <ng-icon name="lucideCircleDashed" />
                      To Do
                    </a>
                    <a z-navigation-menu-link href="#" class="flex-row items-center gap-2">
                      <ng-icon name="lucideCircleCheck" />
                      Done
                    </a>
                  </li>
                </ul>
              </div>
            </ng-template>
          </li>

          <li z-navigation-menu-item>
            <a z-navigation-menu-link href="#" [class]="triggerClass">Docs</a>
          </li>
        </ul>
      </z-navigation-menu>
    </nav>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
  viewProviders: [provideIcons({ lucideCircleAlert, lucideCircleCheck, lucideCircleDashed })],
})
export class ZardDemoNavigationMenuPreviewComponent {
  /** A plain link styled like a trigger, so it lines up with the rest of the bar. */
  protected readonly triggerClass = navigationMenuTriggerVariants();

  protected readonly components: ComponentLink[] = [
    {
      title: 'Alert Dialog',
      href: '/docs/primitives/alert-dialog',
      description: 'A modal dialog that interrupts the user with important content and expects a response.',
    },
    {
      title: 'Hover Card',
      href: '/docs/primitives/hover-card',
      description: 'For sighted users to preview content available behind a link.',
    },
    {
      title: 'Progress',
      href: '/docs/primitives/progress',
      description:
        'Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.',
    },
    {
      title: 'Scroll-area',
      href: '/docs/primitives/scroll-area',
      description: 'Visually or semantically separates content.',
    },
    {
      title: 'Tabs',
      href: '/docs/primitives/tabs',
      description: 'A set of layered sections of content—known as tab panels—that are displayed one at a time.',
    },
    {
      title: 'Tooltip',
      href: '/docs/primitives/tooltip',
      description:
        'A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.',
    },
  ];
}

About

The navigation menu is built on top of the Angular CDK Menu. Angular CDK Menu

Installation

Copy
npx zard-cli@latest add navigation-menu

Usage

import { ZardNavigationMenuImports } from '@/shared/components/navigation-menu/navigation-menu.imports';
Copy
<z-navigation-menu>
  <ul z-navigation-menu-list>
    <li z-navigation-menu-item>
      <button type="button" z-navigation-menu-trigger [zNavigationMenuTriggerFor]="gettingStarted">
        Getting started
      </button>

      <ng-template #gettingStarted>
        <div z-navigation-menu-content>
          <ul class="w-64">
            <li><a z-navigation-menu-link href="#">Introduction</a></li>
            <li><a z-navigation-menu-link href="#">Installation</a></li>
          </ul>
        </div>
      </ng-template>
    </li>
  </ul>
</z-navigation-menu>
Copy

Composition

Use the following composition to build a navigation-menu:

z-navigation-menu
├── ul[z-navigation-menu-list]
│   └── li[z-navigation-menu-item]
│       ├── button[z-navigation-menu-trigger]
│       └── ng-template
│           └── div[z-navigation-menu-content]
│               ├── a[z-navigation-menu-link]
│               └── a[z-navigation-menu-link]
└── z-navigation-menu-indicator
Copy

Examples

Link

Use routerLink on the [z-navigation-menu-link] element to compose with the Angular Router.
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { RouterLink, RouterLinkActive } from '@angular/router';

import { navigationMenuTriggerVariants, ZardNavigationMenuImports } from '@/shared/components/navigation-menu';

@Component({
  selector: 'z-demo-navigation-menu-link',
  imports: [ZardNavigationMenuImports, RouterLink, RouterLinkActive],
  template: `
    <nav aria-label="Docs" class="contents">
      <z-navigation-menu>
        <ul z-navigation-menu-list>
          <li z-navigation-menu-item>
            <a
              z-navigation-menu-link
              routerLink="/docs/components/navigation-menu"
              routerLinkActive
              #navigationMenuLink="routerLinkActive"
              [zActive]="navigationMenuLink.isActive"
              [class]="triggerClass"
            >
              Navigation Menu
            </a>
          </li>
          <li z-navigation-menu-item>
            <a
              z-navigation-menu-link
              routerLink="/docs/components/dropdown"
              routerLinkActive
              #dropdownLink="routerLinkActive"
              [zActive]="dropdownLink.isActive"
              [class]="triggerClass"
            >
              Dropdown
            </a>
          </li>
          <li z-navigation-menu-item>
            <a
              z-navigation-menu-link
              routerLink="/docs/components/tabs"
              routerLinkActive
              #tabsLink="routerLinkActive"
              [zActive]="tabsLink.isActive"
              [class]="triggerClass"
            >
              Tabs
            </a>
          </li>
        </ul>
      </z-navigation-menu>
    </nav>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ZardDemoNavigationMenuLinkComponent {
  protected readonly triggerClass = navigationMenuTriggerVariants();
}

Simple

A bar of plain links, with no dropdown. Reuse navigationMenuTriggerVariants() to keep the height and spacing of a trigger.
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { navigationMenuTriggerVariants, ZardNavigationMenuImports } from '@/shared/components/navigation-menu';

@Component({
  selector: 'z-demo-navigation-menu-simple',
  imports: [ZardNavigationMenuImports],
  template: `
    <nav aria-label="Quick links" class="contents">
      <z-navigation-menu>
        <ul z-navigation-menu-list>
          <li z-navigation-menu-item>
            <a z-navigation-menu-link href="#" zActive [class]="triggerClass">Overview</a>
          </li>
          <li z-navigation-menu-item>
            <a z-navigation-menu-link href="#" [class]="triggerClass">Documentation</a>
          </li>
          <li z-navigation-menu-item>
            <a z-navigation-menu-link href="#" [class]="triggerClass">Blocks</a>
          </li>
          <li z-navigation-menu-item>
            <a z-navigation-menu-link href="#" [class]="triggerClass">Changelog</a>
          </li>
        </ul>
      </z-navigation-menu>
    </nav>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ZardDemoNavigationMenuSimpleComponent {
  /** Reuses the trigger CVA so plain links keep the height and spacing of the bar. */
  protected readonly triggerClass = navigationMenuTriggerVariants();
}

No Viewport

Set [zViewport]="false" so each item opens its own popup, with its own background and ring, instead of sharing the animated viewport. The markup is the same in both modes — only the input changes.
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { ZardNavigationMenuImports } from '@/shared/components/navigation-menu';

@Component({
  selector: 'z-demo-navigation-menu-no-viewport',
  imports: [ZardNavigationMenuImports],
  template: `
    <nav aria-label="Standalone popups" class="contents">
      <z-navigation-menu [zViewport]="false">
        <ul z-navigation-menu-list>
          <li z-navigation-menu-item>
            <button type="button" z-navigation-menu-trigger [zNavigationMenuTriggerFor]="overview">Overview</button>

            <ng-template #overview>
              <div z-navigation-menu-content>
                <ul class="w-56">
                  <li><a z-navigation-menu-link href="#">Introduction</a></li>
                  <li><a z-navigation-menu-link href="#">Installation</a></li>
                  <li><a z-navigation-menu-link href="#">Theming</a></li>
                </ul>
              </div>
            </ng-template>
          </li>

          <li z-navigation-menu-item>
            <button type="button" z-navigation-menu-trigger [zNavigationMenuTriggerFor]="resources">Resources</button>

            <ng-template #resources>
              <div z-navigation-menu-content>
                <ul class="w-56">
                  <li><a z-navigation-menu-link href="#">Blocks</a></li>
                  <li><a z-navigation-menu-link href="#">Changelog</a></li>
                  <li><a z-navigation-menu-link href="#">Contributing</a></li>
                </ul>
              </div>
            </ng-template>
          </li>
        </ul>
      </z-navigation-menu>
    </nav>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ZardDemoNavigationMenuNoViewportComponent {}

RTL

To enable RTL support in zard/ui, see the RTL configuration guide.
// You will notice this example is rendered inside a wrapper that sets the dir and data-lang attributes, and
// reads its text from a translations helper. This is because this site is not RTL by default.
// In your application you won't need either: set dir="rtl" on <html> (or use the CDK Dir directive on a subtree)
// and write the text of your own language. See the RTL guide: https://zardui.com/docs/rtl

import { ChangeDetectionStrategy, Component } from '@angular/core';

import { NgIcon, provideIcons } from '@ng-icons/core';
import { lucideCircleAlert, lucideCircleCheck, lucideCircleDashed } from '@ng-icons/lucide';

import { navigationMenuTriggerVariants, ZardNavigationMenuImports } from '@/shared/components/navigation-menu';
import { injectRtlTranslation, type ZardRtlTranslations } from '@/shared/demo-utils/rtl-translation';

interface NavigationMenuRtlValues {
  gettingStarted: string;
  introduction: string;
  introductionDesc: string;
  installation: string;
  installationDesc: string;
  typography: string;
  typographyDesc: string;
  components: string;
  alertDialog: string;
  alertDialogDesc: string;
  hoverCard: string;
  hoverCardDesc: string;
  progress: string;
  progressDesc: string;
  scrollArea: string;
  scrollAreaDesc: string;
  tabs: string;
  tabsDesc: string;
  tooltip: string;
  tooltipDesc: string;
  withIcon: string;
  backlog: string;
  toDo: string;
  done: string;
  docs: string;
}

type ComponentKey = 'alertDialog' | 'hoverCard' | 'progress' | 'scrollArea' | 'tabs' | 'tooltip';

const translations: ZardRtlTranslations<NavigationMenuRtlValues> = {
  en: {
    dir: 'ltr',
    values: {
      gettingStarted: 'Getting started',
      introduction: 'Introduction',
      introductionDesc: 'Re-usable components built with Tailwind CSS.',
      installation: 'Installation',
      installationDesc: 'How to install dependencies and structure your app.',
      typography: 'Typography',
      typographyDesc: 'Styles for headings, paragraphs, lists...etc',
      components: 'Components',
      alertDialog: 'Alert Dialog',
      alertDialogDesc: 'A modal dialog that interrupts the user with important content and expects a response.',
      hoverCard: 'Hover Card',
      hoverCardDesc: 'For sighted users to preview content available behind a link.',
      progress: 'Progress',
      progressDesc:
        'Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.',
      scrollArea: 'Scroll-area',
      scrollAreaDesc: 'Visually or semantically separates content.',
      tabs: 'Tabs',
      tabsDesc: 'A set of layered sections of content—known as tab panels—that are displayed one at a time.',
      tooltip: 'Tooltip',
      tooltipDesc:
        'A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.',
      withIcon: 'With Icon',
      backlog: 'Backlog',
      toDo: 'To Do',
      done: 'Done',
      docs: 'Docs',
    },
  },
  ar: {
    dir: 'rtl',
    values: {
      gettingStarted: 'البدء',
      introduction: 'مقدمة',
      introductionDesc: 'مكونات قابلة لإعادة الاستخدام مبنية باستخدام Tailwind CSS.',
      installation: 'التثبيت',
      installationDesc: 'كيفية تثبيت التبعيات وتنظيم تطبيقك.',
      typography: 'الطباعة',
      typographyDesc: 'أنماط للعناوين والفقرات والقوائم...إلخ',
      components: 'المكونات',
      alertDialog: 'حوار التنبيه',
      alertDialogDesc: 'حوار نافذة يقطع المستخدم بمحتوى مهم ويتوقع استجابة.',
      hoverCard: 'بطاقة التحويم',
      hoverCardDesc: 'للمستخدمين المبصرين لمعاينة المحتوى المتاح خلف الرابط.',
      progress: 'التقدم',
      progressDesc: 'يعرض مؤشرًا يوضح تقدم إتمام المهمة، عادةً يتم عرضه كشريط تقدم.',
      scrollArea: 'منطقة التمرير',
      scrollAreaDesc: 'يفصل المحتوى بصريًا أو دلاليًا.',
      tabs: 'التبويبات',
      tabsDesc: 'مجموعة من أقسام المحتوى المتعددة الطبقات—المعروفة بألواح التبويب—التي يتم عرضها واحدة في كل مرة.',
      tooltip: 'تلميح',
      tooltipDesc:
        'نافذة منبثقة تعرض معلومات متعلقة بعنصر عندما يتلقى العنصر التركيز على لوحة المفاتيح أو عند تحويم الماوس فوقه.',
      withIcon: 'مع أيقونة',
      backlog: 'قائمة الانتظار',
      toDo: 'المهام',
      done: 'منجز',
      docs: 'الوثائق',
    },
  },
  he: {
    dir: 'rtl',
    values: {
      gettingStarted: 'התחלה',
      introduction: 'הקדמה',
      introductionDesc: 'רכיבים לשימוש חוזר שנבנו עם Tailwind CSS.',
      installation: 'התקנה',
      installationDesc: 'כיצד להתקין תלויות ולבנות את האפליקציה שלך.',
      typography: 'טיפוגרפיה',
      typographyDesc: "סגנונות לכותרות, פסקאות, רשימות...וכו'",
      components: 'רכיבים',
      alertDialog: 'דיאלוג התראה',
      alertDialogDesc: 'דיאלוג מודאלי שמפריע למשתמש עם תוכן חשוב ומצפה לתגובה.',
      hoverCard: 'כרטיס ריחוף',
      hoverCardDesc: 'למשתמשים רואים כדי להציג תצוגה מקדימה של תוכן זמין מאחורי קישור.',
      progress: 'התקדמות',
      progressDesc: 'מציג אינדיקטור המציג את התקדמות ההשלמה של משימה, בדרך כלל מוצג כסרגל התקדמות.',
      scrollArea: 'אזור גלילה',
      scrollAreaDesc: 'מפריד תוכן חזותית או סמנטית.',
      tabs: 'כרטיסיות',
      tabsDesc: 'קבוצה של חלקי תוכן מרובדים—המכונים לוחות כרטיסיות—המוצגים אחד בכל פעם.',
      tooltip: 'טולטיפ',
      tooltipDesc: 'חלון קופץ המציג מידע הקשור לאלמנט כאשר האלמנט מקבל מיקוד מקלדת או כאשר העכבר מרחף מעליו.',
      withIcon: 'עם אייקון',
      backlog: 'רשימת המתנה',
      toDo: 'לעשות',
      done: 'הושלם',
      docs: 'תיעוד',
    },
  },
};

@Component({
  selector: 'z-demo-navigation-menu-rtl',
  imports: [ZardNavigationMenuImports, NgIcon],
  template: `
    <nav aria-label="Main" class="contents">
      <z-navigation-menu>
        <ul z-navigation-menu-list>
          <li z-navigation-menu-item>
            <button type="button" z-navigation-menu-trigger [zNavigationMenuTriggerFor]="gettingStarted">
              {{ i18n.t().gettingStarted }}
            </button>

            <ng-template #gettingStarted>
              <div z-navigation-menu-content>
                <ul class="w-96">
                  <li>
                    <a z-navigation-menu-link href="#">
                      <div class="flex flex-col gap-1 text-sm">
                        <div class="leading-none font-medium">{{ i18n.t().introduction }}</div>
                        <div class="text-muted-foreground line-clamp-2">{{ i18n.t().introductionDesc }}</div>
                      </div>
                    </a>
                  </li>
                  <li>
                    <a z-navigation-menu-link href="#">
                      <div class="flex flex-col gap-1 text-sm">
                        <div class="leading-none font-medium">{{ i18n.t().installation }}</div>
                        <div class="text-muted-foreground line-clamp-2">{{ i18n.t().installationDesc }}</div>
                      </div>
                    </a>
                  </li>
                  <li>
                    <a z-navigation-menu-link href="#">
                      <div class="flex flex-col gap-1 text-sm">
                        <div class="leading-none font-medium">{{ i18n.t().typography }}</div>
                        <div class="text-muted-foreground line-clamp-2">{{ i18n.t().typographyDesc }}</div>
                      </div>
                    </a>
                  </li>
                </ul>
              </div>
            </ng-template>
          </li>

          <li z-navigation-menu-item class="hidden md:flex">
            <button type="button" z-navigation-menu-trigger [zNavigationMenuTriggerFor]="componentsMenu">
              {{ i18n.t().components }}
            </button>

            <ng-template #componentsMenu>
              <div z-navigation-menu-content>
                <ul class="grid w-[400px] gap-2 md:w-[500px] md:grid-cols-2 lg:w-[600px]">
                  @for (component of components; track component.key) {
                    <li>
                      <a z-navigation-menu-link href="#">
                        <div class="flex flex-col gap-1 text-sm">
                          <div class="leading-none font-medium">{{ i18n.t()[component.key] }}</div>
                          <div class="text-muted-foreground line-clamp-2">{{ i18n.t()[component.description] }}</div>
                        </div>
                      </a>
                    </li>
                  }
                </ul>
              </div>
            </ng-template>
          </li>

          <li z-navigation-menu-item>
            <button type="button" z-navigation-menu-trigger [zNavigationMenuTriggerFor]="withIcon">
              {{ i18n.t().withIcon }}
            </button>

            <ng-template #withIcon>
              <div z-navigation-menu-content>
                <ul class="grid w-[200px]">
                  <li>
                    <a z-navigation-menu-link href="#" class="flex-row items-center gap-2">
                      <ng-icon name="lucideCircleAlert" />
                      {{ i18n.t().backlog }}
                    </a>
                    <a z-navigation-menu-link href="#" class="flex-row items-center gap-2">
                      <ng-icon name="lucideCircleDashed" />
                      {{ i18n.t().toDo }}
                    </a>
                    <a z-navigation-menu-link href="#" class="flex-row items-center gap-2">
                      <ng-icon name="lucideCircleCheck" />
                      {{ i18n.t().done }}
                    </a>
                  </li>
                </ul>
              </div>
            </ng-template>
          </li>

          <li z-navigation-menu-item>
            <a z-navigation-menu-link href="#" [class]="triggerClass">{{ i18n.t().docs }}</a>
          </li>
        </ul>
      </z-navigation-menu>
    </nav>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
  viewProviders: [provideIcons({ lucideCircleAlert, lucideCircleCheck, lucideCircleDashed })],
})
export class ZardDemoNavigationMenuRtlComponent {
  protected readonly i18n = injectRtlTranslation(translations);

  /** A plain link styled like a trigger, so it lines up with the rest of the bar. */
  protected readonly triggerClass = navigationMenuTriggerVariants();

  protected readonly components: { key: ComponentKey; description: `${ComponentKey}Desc` }[] = [
    { key: 'alertDialog', description: 'alertDialogDesc' },
    { key: 'hoverCard', description: 'hoverCardDesc' },
    { key: 'progress', description: 'progressDesc' },
    { key: 'scrollArea', description: 'scrollAreaDesc' },
    { key: 'tabs', description: 'tabsDesc' },
    { key: 'tooltip', description: 'tooltipDesc' },
  ];
}

API Reference

z-navigation-menu

Root of the navigation bar; wrap it in a labelled <nav>.

Prop
[class]

Custom CSS classes

Type
ClassValue
Default
''
[zViewport]

Shares one popup between all triggers

Type
boolean
Default
true
[zAlign]

Viewport alignment to the active trigger

Type
'start' | 'center' | 'end'
Default
'start'
[zHoverDelay]

Close delay in ms after the pointer leaves

Type
number
Default
100

[z-navigation-menu-list]

The <ul> holding the items of the bar.

Prop
[class]

Custom CSS classes

Type
ClassValue
Default
''

[z-navigation-menu-item]

The <li> wrapping a trigger and its content, or a link.

Prop
[class]

Custom CSS classes

Type
ClassValue
Default
''

[z-navigation-menu-trigger]

Opens its content; on hover inside a root, on click standalone.

Prop
[zNavigationMenuTriggerFor]

Content template

Type
TemplateRef<void>
Default
required
[zDisabled]

Disables the trigger

Type
boolean
Default
false
[zTrigger]

How the content opens

Type
'click' | 'hover'
Default
'hover' inside a root, 'click' standalone
[zHoverDelay]

Close delay in ms on hover exit

Type
number
Default
100
[zPlacement]

Popup position; overlay mode only, mirrors in RTL

Type
ZardNavigationMenuPlacement
Default
'bottomLeft'
[zShowChevron]

Shows the chevron

Type
boolean
Default
true inside a root, false standalone
[class]

Custom CSS classes

Type
ClassValue
Default
''

[z-navigation-menu-content]

Holds the links of one trigger.

Prop
[class]

Custom CSS classes

Type
ClassValue
Default
''

[z-navigation-menu-link]

A link on a <button> or <a>; pair [zActive] with routerLinkActive.

Prop
[zActive]

Marks the current link

Type
boolean
Default
false
[zDisabled]

Disables the link

Type
boolean
Default
false
[zInset]

Adds start padding for alignment

Type
boolean
Default
false
[zType]

Visual variant

Type
'default' | 'destructive'
Default
'default'
[class]

Custom CSS classes

Type
ClassValue
Default
''
(menuItemTriggered)

Emitted when the link is activated

Type
EventEmitter<void>
Default
—

z-navigation-menu-indicator

Arrow that follows the active trigger.

Prop
[class]

Custom CSS classes

Type
ClassValue
Default
''

z-navigation-menu-viewport

The shared popup; rendered automatically unless you place it yourself.

z-navigation-menu-label

Label for a group of links.

Prop
[class]

Custom CSS classes

Type
ClassValue
Default
''
[inset]

Adds start padding for alignment

Type
boolean
Default
false

z-navigation-menu-shortcut

Keyboard shortcut at the end of a link.

Prop
[class]

Custom CSS classes

Type
ClassValue
Default
''

navigationMenuTriggerVariants()

Returns the trigger classes, for links that must match the triggers.

github iconwhatsapp icondiscord iconX icon

Made with ❤ in Brazil. Open source and available on GitHub .