kliping.pro
  • Docs
  • Explore
  • Builder
  • Directory
  • Colors
  • Typeset
Saved
Docs
  • Sections13
  • Installation5
  • Dark Mode4
  • Forms3
  • Registry6
  • Utilities2
  • More10
  • Components137
  • Accordion
  • Action Bar
  • AI Chat
  • AI Thread List
  • Alert
  • Alert Dialog
  • Angle Slider
  • Animated Grid Pattern
  • Aspect Ratio
  • Attachment
  • Avatar
  • Avatar Group
  • Badge
  • Badge Overflow
  • Banner
  • Border Beam
  • Breadcrumb
  • Bubble
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Checkbox Group
  • Chip
  • Circular Progress
  • Client Only
  • Collapsible
  • Color Picker
  • Color Swatch
  • Combobox
  • Combobox Advanced
  • Command
  • Compare Slider
  • Composition
  • Context Menu
  • Cropper
  • Data Grid
  • Data Table
  • Data Table Advanced
  • Date Picker
  • Dialog
  • Direction Provider
  • Dot Pattern
  • Drawer
  • Dropdown Menu
  • Editable
  • Empty
  • Field
  • File Upload
  • Form
  • FPS
  • Gauge
  • Hitbox
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Kbd Advanced
  • Key Value
  • Label
  • List
  • Listbox
  • Logos
  • Map
  • Marker
  • Marquee
  • Mask Input
  • Masonry
  • Media Player
  • Mention
  • Menubar
  • Message
  • Message Scroller
  • Native Select
  • Navigation Menu
  • Number Field
  • Pagination
  • Particles
  • Pending
  • Phone Input
  • Pin Input
  • Popover
  • Portal
  • Presence
  • Progress
  • QR Code
  • Questionnaire
  • Radio Group
  • Range Calendar
  • Rating
  • Relative Time Card
  • Resizable
  • Responsive Dialog
  • Scroll Area
  • Scroll Spy
  • Scroller
  • Segmented Input
  • Select
  • Selection Toolbar
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Software Purchase Card
  • Sonner
  • Sortable
  • Speed Dial
  • Spinner
  • Stack
  • Stat
  • Status
  • Stepper
  • Stepper Advanced
  • Swap
  • Switch
  • Table
  • Tabs
  • Tags Input
  • Tags Input Advanced
  • Textarea
  • Time Picker
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tour
  • Typography
  • Visually Hidden
  • Visually Hidden Input
  1. Docs
  2. Components
  3. Navigation Menu

Navigation Menu

PreviousNext

Kumpulan tautan untuk menavigasi situs.

View 8 variants
Docs API Reference
  • Docs

Installation ​

pnpm dlx kliping@latest add navigation-menu

Pasang dependensi berikut:

pnpm add reka-ui

Salin dan tempel kode sumber di GitHub ke project Anda.

Sesuaikan path import dengan struktur project Anda.

Usage ​

vue
<script setup lang="ts">
import {
  NavigationMenu,
  NavigationMenuContent,
  NavigationMenuIndicator,
  NavigationMenuItem,
  NavigationMenuLink,
  NavigationMenuList,
  NavigationMenuTrigger,
  NavigationMenuViewport,
} from '@/components/ui/navigation-menu'
</script>

<template>
  <NavigationMenu>
    <NavigationMenuList>
      <NavigationMenuItem>
        <NavigationMenuTrigger>Item One</NavigationMenuTrigger>
        <NavigationMenuContent>
          <NavigationMenuLink>Link</NavigationMenuLink>
        </NavigationMenuContent>
      </NavigationMenuItem>
    </NavigationMenuList>
  </NavigationMenu>
</template>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

Requirements ​

Semua dipasang otomatis oleh kliping add; tabel ini untuk Anda yang memasang manual atau memeriksa project.

RequirementValue
ProjectVue 3.5+, Tailwind CSS v4, alias @ — disiapkan kliping init
npm packages@lucide/vue@^1.31.0, @vueuse/core@^14.4.0, class-variance-authority@^0.7.1, reka-ui@^2.10.3
Filescomponents/ui/navigation-menu/navigation-menu.vue
components/ui/navigation-menu/navigation-menu-content.vue
components/ui/navigation-menu/navigation-menu-indicator.vue
components/ui/navigation-menu/navigation-menu-item.vue
components/ui/navigation-menu/navigation-menu-link.vue
components/ui/navigation-menu/navigation-menu-list.vue
components/ui/navigation-menu/navigation-menu-trigger.vue
components/ui/navigation-menu/navigation-menu-viewport.vue
components/ui/navigation-menu/index.ts

Anatomy ​

Susunan bagiannya seperti dipakai di contoh-contoh di atas. Impor semua bagian dari satu tempat, lalu susun begini:

vue
<NavigationMenu>
  <NavigationMenuList>
    <NavigationMenuItem>
      <NavigationMenuTrigger />
      <NavigationMenuContent>
        <NavigationMenuLink />
      </NavigationMenuContent>
      <NavigationMenuLink />
    </NavigationMenuItem>
  </NavigationMenuList>
</NavigationMenu>
<NavigationMenuLink />

Bagian lain yang tersedia: NavigationMenuIndicator, NavigationMenuViewport.

API Reference ​

NavigationMenu ​

PropTypeDefaultDescription
modelValue?string—The controlled value of the menu item to activate. Can be used as v-model.
defaultValue?string—The value of the menu item that should be active when initially rendered. Use when you do not need to control the value state.
dir?Direction$3—The reading direction of the combobox when applicable. If omitted, inherits globally from ConfigProvider or assumes LTR (left-to-right) reading mode.
orientation?Orientation—The orientation of the menu.
delayDuration?number—The duration from when the pointer enters the trigger until the tooltip gets opened.
skipDelayDuration?number—How much time a user has to enter another trigger without incurring a delay again.
disableClickTrigger?boolean—If true, menu cannot be open by click on trigger
disableHoverTrigger?boolean—If true, menu cannot be open by hover on trigger
disablePointerLeaveClose?boolean—If true, menu will not close during pointer leave event
unmountOnHide?boolean—When true, the element will be unmounted on closed state.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
viewport?booleantrueRenders the shared viewport that hosts open content (default true); false shows content inline.
EventPayloadDescription
@update:modelValue[value: string]Emitted when the value changes.
SlotProps
#default{ modelValue: string; }
Data attributeValue
[data-slot]"navigation-menu"
[data-viewport]boolean

NavigationMenuContent ​

PropTypeDefaultDescription
forceMount?boolean—Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries.
disableOutsidePointerEvents?boolean—When true, hover/focus/click interactions will be disabled on elements outside the DismissableLayer. Users will need to click twice on outside elements to interact with them: once to close the DismissableLayer, and again to trigger the element.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
EventPayloadDescription
@escapeKeyDown[event: KeyboardEvent]Emitted when Escape is pressed; call event.preventDefault() to keep it open.
@pointerDownOutside[event: PointerDownOutsideEvent]Emitted on a pointer down outside; call event.preventDefault() to keep it open.
@focusOutside[event: FocusOutsideEvent]Emitted when focus moves outside; call event.preventDefault() to keep it open.
@interactOutside[event: PointerDownOutsideEvent | FocusOutsideEvent]Emitted on any pointer down or focus outside; call event.preventDefault() to keep it open.
SlotProps
#default—
Data attributeValue
[data-slot]"navigation-menu-content"

NavigationMenuIndicator ​

PropTypeDefaultDescription
forceMount?boolean—Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
Data attributeValue
[data-slot]"navigation-menu-indicator"

NavigationMenuItem ​

PropTypeDefaultDescription
value?string—A unique value that associates the item with an active value when the navigation menu is controlled. This prop is managed automatically when uncontrolled.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
SlotProps
#default—
Data attributeValue
[data-slot]"navigation-menu-item"

NavigationMenuLink ​

PropTypeDefaultDescription
active?boolean—Used to identify the link as the currently active page.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
EventPayloadDescription
@select[payload: CustomEvent<{ originalEvent: Event; }>]Emitted when it is selected, by pointer or keyboard; call event.preventDefault() to keep the menu open.
SlotProps
#default—
Data attributeValue
[data-slot]"navigation-menu-link"
[data-active]boolean

NavigationMenuList ​

PropTypeDefaultDescription
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
SlotProps
#default—
Data attributeValue
[data-slot]"navigation-menu-list"

NavigationMenuTrigger ​

PropTypeDefaultDescription
disabled?boolean—When true, prevents the user from interacting with item
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
SlotProps
#default—
Data attributeValue
[data-slot]"navigation-menu-trigger"

NavigationMenuViewport ​

PropTypeDefaultDescription
forceMount?boolean—Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries.
align?"start" | "end" | "center"—Placement of the viewport for css variables (--reka-navigation-menu-viewport-left, --reka-navigation-menu-viewport-top).
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
Data attributeValue
[data-slot]"navigation-menu-viewport"

Keyboard Interactions ​

Perilaku keyboard-nya datang dari primitif Reka UI NavigationMenu yang dipakai komponen ini, mengikuti pola WAI-ARIA.

KeyDescription
Space + EnterWhen focus is on NavigationMenuTrigger, opens the content.
TabMoves focus to the next focusable element.
ArrowDownWhen horizontal and focus is on an open NavigationMenuTrigger, moves focus into NavigationMenuContent. Moves focus to the next NavigationMenuTrigger or NavigationMenuLink.
ArrowUpMoves focus to the previous NavigationMenuTrigger or NavigationMenuLink.
ArrowRight + ArrowLeftWhen vertical and focus is on an open NavigationMenuTrigger, moves focus into its NavigationMenuContent. Moves focus to the next / previous NavigationMenuTrigger or NavigationMenuLink.
Home + EndMoves focus to the first/last NavigationMenu.Trigger or NavigationMenu.Link.
EscCloses open NavigationMenu.Content and moves focus to its NavigationMenu.Trigger.

CSS Variables ​

Token tema yang dibaca komponen ini — ubah nilainya di CSS global (:root dan .dark, lihat Theming) untuk mengubah tampilannya tanpa menyentuh komponennya: --accent, --accent-foreground, --background, --border, --muted-foreground, --popover, --popover-foreground, --radius, --ring.

Credits ​

Berasal dari shadcn-vue (MIT, Copyright (c) 2023 unovue). Rantai lengkapnya di Credits.

PreviousNative SelectNext Number Field

On This Page

InstallationUsageRequirementsAnatomyAPI ReferenceNavigationMenuNavigationMenuContentNavigationMenuIndicatorNavigationMenuItemNavigationMenuLinkNavigationMenuListNavigationMenuTriggerNavigationMenuViewportKeyboard InteractionsCSS VariablesCredits

© 2026 Kliping. Free components are open source under the MIT License.

LicenseCreditsRoadmap