Components
Navigation Menu
Top-level site navigation with hover and focus flyout panels.
NavigationMenu is for application or documentation navigation, not command menus. It renders semantic nav markup, top-level triggers/links, and collision-aware flyout content from an items array.
Anatomy
#trigger: Custom top-level flyout trigger content.#link: Custom top-level direct-link content.#item: Custom flyout item content.#[item.slot]: Per-item override for triggers or links.
Top-level list, item wrappers, trigger/link elements, content viewport, and flyout links are generated by the component.
Usage
Examples
Controlled open state
Bind v-model:open to observe or control the currently open flyout.
<script setup lang="ts">
import { ref } from "vue";
const open = ref<string | null>(null);
</script>
<template>
<NavigationMenu v-model:open="open" :items="items" />
</template>
Custom flyout items
Use #item for richer content while the component keeps generated list and link structure.
<template>
<NavigationMenu :items="items">
<template #item="{ item }">
<strong>{{ item.label }}</strong>
<small>{{ item.description }}</small>
</template>
</NavigationMenu>
</template>
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | NavigationMenuItem[] | required | Top-level navigation items. |
loop | boolean | true | Left/right trigger focus wraps. |
dir | "ltr" | "rtl" | "ltr" | Horizontal keyboard direction. |
disabled | boolean | false | Disables trigger interaction. |
openDelay | number | 80 | Pointer-open delay in milliseconds. |
closeDelay | number | 150 | Pointer-close delay in milliseconds. |
ariaLabel | string | "Primary" | Accessible nav label. |
ui | NavigationMenuUi | — | Classes for structural parts. |
Emits
| Event | Payload | Description |
|---|---|---|
open-change | (value: string | null, details) | Fired before active flyout changes. |
select | (item, details) | Fired when a link/item is selected. |
Slots
| Slot | Props | Description |
|---|---|---|
trigger | item, isOpen | Top-level flyout trigger content. |
link | item, isOpen | Top-level direct-link content. |
item | item | Flyout item content. |
[item.slot] | item, isOpen | Per-item override at any supported level. |
Item Shape
| Key | Type | Description |
|---|---|---|
value | string | Stable id. Falls back to href then label. |
label | string | Visible label. |
href | string | Link target. |
to | unknown | Router destination passed to custom as component. |
as | string | Component | Custom link component, such as RouterLink. |
description | string | Optional flyout description. |
disabled | boolean | Disables the item. |
active | boolean | Adds aria-current. |
ariaCurrent | ARIA current value | Defaults to "page" when active. |
children | NavigationMenuItem[] | Flyout links. |
slot | string | Named per-item slot. |
onSelect | () => void | Runs after uncanceled select event. |
UI Options
| Key | Description |
|---|---|
root | Root nav. |
list | Top-level list. |
item | Top-level item wrapper. |
trigger | Top-level item with flyout. |
link | Top-level direct link. |
indicator | Active flyout indicator. |
content | Flyout wrapper. |
viewport | Flyout viewport. |
contentList | Flyout list. |
contentItem | Flyout item wrapper. |
contentLink | Flyout link. |
label | Flyout item label. |
description | Flyout item description. |
Styling Hooks
| UI key | CSS class | Data attrs |
|---|---|---|
root | akaza-navigation-menu | data-akaza-state, data-akaza-disabled |
list | akaza-navigation-menu-list | — |
item | akaza-navigation-menu-item | data-akaza-state, data-akaza-disabled |
trigger | akaza-navigation-menu-trigger | data-akaza-state, data-akaza-disabled |
link | akaza-navigation-menu-link | data-akaza-state, data-akaza-disabled, aria-current |
indicator | akaza-navigation-menu-indicator | data-akaza-state |
content | akaza-navigation-menu-content | data-akaza-state, data-akaza-side, data-akaza-align, --akaza-navigation-menu-anchor-width, --akaza-navigation-menu-anchor-height, --akaza-navigation-menu-available-width, --akaza-navigation-menu-available-height, --akaza-navigation-menu-transform-origin, --akaza-navigation-menu-duration |
viewport | akaza-navigation-menu-viewport | — |
contentList | akaza-navigation-menu-content-list | — |
contentItem | akaza-navigation-menu-content-item | data-akaza-disabled |
contentLink | akaza-navigation-menu-content-link | — |
label | akaza-navigation-menu-label | — |
description | akaza-navigation-menu-description | — |
Flyout entry and exit use a subtle side-aware structural transition. Override --akaza-navigation-menu-duration to change its 120ms duration. Reduced-motion preference shortens it automatically.
Keyboard
| Key | Behavior |
|---|---|
ArrowRight / ArrowLeft | Move between top-level items. |
ArrowDown / Enter / Space | Open a flyout item. |
Home / End | Focus first/last enabled top-level item. |
| Character keys | Typeahead across top-level items. |
ArrowDown / ArrowUp in flyout | Move through enabled flyout links. |
Escape | Close the active flyout. |