Skip to main content
Version: v1 (Current)

Navigation Menu

Generated from public Vue/TypeScript exports by pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commit fc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.

import { NavigationMenu } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
modelValuestring | undefined—The controlled value of the menu item to activate. Can be used as v-model.
defaultValuestring | undefined—The value of the menu item that should be active when initially rendered. Use when you do not need to control the value state.
dirDirection$3 | undefined—The reading direction of the combobox when applicable. If omitted, inherits globally from ConfigProvider or assumes LTR (left-to-right) reading mode.
orientationOrientation | undefined—The orientation of the menu.
delayDurationnumber | undefined—The duration from when the pointer enters the trigger until the tooltip gets opened.
skipDelayDurationnumber | undefined—How much time a user has to enter another trigger without incurring a delay again.
disableClickTriggerboolean | undefined—If true, menu cannot be open by click on trigger
disableHoverTriggerboolean | undefined—If true, menu cannot be open by hover on trigger
disablePointerLeaveCloseboolean | undefined—If true, menu will not close during pointer leave event
unmountOnHideboolean | undefined—When true, the element will be unmounted on closed state.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Events​

NameTypeRequired / defaultDescription
update:modelValue[value: string]——

Slots​

NameTypeRequired / defaultDescription
default{}——
viewport{}——

Examples​

These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '.'
{
render: () => ({
components: {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
},
setup() {
return { navigationMenuTriggerStyle }
},
template: `
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Getting Started</NavigationMenuTrigger>
<NavigationMenuContent>
<div class="grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]">
<div class="row-span-3">
<NavigationMenuLink as-child>
<a
class="flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md"
href="/"
>
<div class="mb-2 mt-4 text-lg font-medium">shadcn/ui</div>
<p class="text-sm leading-tight text-muted-foreground">
Beautifully designed components built with Reka UI and Tailwind CSS.
</p>
</a>
</NavigationMenuLink>
</div>
<NavigationMenuLink as-child>
<a href="/docs" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Introduction</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Re-usable components built using Reka UI and Tailwind CSS.</p>
</a>
</NavigationMenuLink>
<NavigationMenuLink as-child>
<a href="/docs/installation" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Installation</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">How to install dependencies and structure your app.</p>
</a>
</NavigationMenuLink>
<NavigationMenuLink as-child>
<a href="/docs/primitives/typography" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Typography</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Styles for headings, paragraphs, lists...etc</p>
</a>
</NavigationMenuLink>
</div>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuTrigger>Components</NavigationMenuTrigger>
<NavigationMenuContent>
<ul class="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px]">
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/alert-dialog" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Alert Dialog</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">A modal dialog that interrupts the user with important content.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/hover-card" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Hover Card</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">For sighted users to preview content available behind a link.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/progress" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Progress</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Displays an indicator showing the completion progress of a task.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/scroll-area" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Scroll-area</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Visually or semantically separates content.</p>
</a>
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="/docs">
Documentation
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '.'
{
name: 'Showcase',
render: () => ({
components: {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
},
setup() {
return { navigationMenuTriggerStyle }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Navigation Menu with Triggers</h3>
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Products</NavigationMenuTrigger>
<NavigationMenuContent>
<ul class="grid gap-3 p-4 md:w-[400px] md:grid-cols-2">
<li>
<NavigationMenuLink as-child>
<a href="#" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Analytics</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Track and analyze your data.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="#" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Engagement</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Measure and improve engagement.</p>
</a>
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Pricing
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
About
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Simple Links Only</h3>
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Home
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Features
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Pricing
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Contact
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</div>
</div>
`,
}),
}

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport } from './index'
{ render: () => ({ components: { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport }, template: `<NavigationMenu><NavigationMenuList><NavigationMenuItem><NavigationMenuTrigger>Explore</NavigationMenuTrigger><NavigationMenuContent class="p-4"><NavigationMenuLink href="#collections">Collections</NavigationMenuLink></NavigationMenuContent></NavigationMenuItem><NavigationMenuIndicator /></NavigationMenuList><template #viewport><NavigationMenuViewport /></template></NavigationMenu>` }) }
import { NavigationMenuContent } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
forceMountboolean | undefined—Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries.
disableOutsidePointerEventsboolean | undefined—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.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Events​

NameTypeRequired / defaultDescription
escapeKeyDown[event: KeyboardEvent]——
pointerDownOutside[event: PointerDownOutsideEvent]——
focusOutside[event: FocusOutsideEvent]——
interactOutside[event: PointerDownOutsideEvent | FocusOutsideEvent]——

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '.'
{
render: () => ({
components: {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
},
setup() {
return { navigationMenuTriggerStyle }
},
template: `
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Getting Started</NavigationMenuTrigger>
<NavigationMenuContent>
<div class="grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]">
<div class="row-span-3">
<NavigationMenuLink as-child>
<a
class="flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md"
href="/"
>
<div class="mb-2 mt-4 text-lg font-medium">shadcn/ui</div>
<p class="text-sm leading-tight text-muted-foreground">
Beautifully designed components built with Reka UI and Tailwind CSS.
</p>
</a>
</NavigationMenuLink>
</div>
<NavigationMenuLink as-child>
<a href="/docs" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Introduction</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Re-usable components built using Reka UI and Tailwind CSS.</p>
</a>
</NavigationMenuLink>
<NavigationMenuLink as-child>
<a href="/docs/installation" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Installation</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">How to install dependencies and structure your app.</p>
</a>
</NavigationMenuLink>
<NavigationMenuLink as-child>
<a href="/docs/primitives/typography" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Typography</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Styles for headings, paragraphs, lists...etc</p>
</a>
</NavigationMenuLink>
</div>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuTrigger>Components</NavigationMenuTrigger>
<NavigationMenuContent>
<ul class="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px]">
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/alert-dialog" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Alert Dialog</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">A modal dialog that interrupts the user with important content.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/hover-card" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Hover Card</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">For sighted users to preview content available behind a link.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/progress" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Progress</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Displays an indicator showing the completion progress of a task.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/scroll-area" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Scroll-area</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Visually or semantically separates content.</p>
</a>
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="/docs">
Documentation
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '.'
{
name: 'Showcase',
render: () => ({
components: {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
},
setup() {
return { navigationMenuTriggerStyle }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Navigation Menu with Triggers</h3>
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Products</NavigationMenuTrigger>
<NavigationMenuContent>
<ul class="grid gap-3 p-4 md:w-[400px] md:grid-cols-2">
<li>
<NavigationMenuLink as-child>
<a href="#" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Analytics</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Track and analyze your data.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="#" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Engagement</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Measure and improve engagement.</p>
</a>
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Pricing
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
About
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Simple Links Only</h3>
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Home
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Features
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Pricing
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Contact
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</div>
</div>
`,
}),
}

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport } from './index'
{ render: () => ({ components: { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport }, template: `<NavigationMenu><NavigationMenuList><NavigationMenuItem><NavigationMenuTrigger>Explore</NavigationMenuTrigger><NavigationMenuContent class="p-4"><NavigationMenuLink href="#collections">Collections</NavigationMenuLink></NavigationMenuContent></NavigationMenuItem><NavigationMenuIndicator /></NavigationMenuList><template #viewport><NavigationMenuViewport /></template></NavigationMenu>` }) }
import { NavigationMenuIndicator } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
forceMountboolean | undefined—Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport } from './index'
{ render: () => ({ components: { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport }, template: `<NavigationMenu><NavigationMenuList><NavigationMenuItem><NavigationMenuTrigger>Explore</NavigationMenuTrigger><NavigationMenuContent class="p-4"><NavigationMenuLink href="#collections">Collections</NavigationMenuLink></NavigationMenuContent></NavigationMenuItem><NavigationMenuIndicator /></NavigationMenuList><template #viewport><NavigationMenuViewport /></template></NavigationMenu>` }) }
import { NavigationMenuItem } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
valuestring | undefined—A unique value that associates the item with an active value when the navigation menu is controlled. This prop is managed automatically when uncontrolled.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '.'
{
render: () => ({
components: {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
},
setup() {
return { navigationMenuTriggerStyle }
},
template: `
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Getting Started</NavigationMenuTrigger>
<NavigationMenuContent>
<div class="grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]">
<div class="row-span-3">
<NavigationMenuLink as-child>
<a
class="flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md"
href="/"
>
<div class="mb-2 mt-4 text-lg font-medium">shadcn/ui</div>
<p class="text-sm leading-tight text-muted-foreground">
Beautifully designed components built with Reka UI and Tailwind CSS.
</p>
</a>
</NavigationMenuLink>
</div>
<NavigationMenuLink as-child>
<a href="/docs" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Introduction</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Re-usable components built using Reka UI and Tailwind CSS.</p>
</a>
</NavigationMenuLink>
<NavigationMenuLink as-child>
<a href="/docs/installation" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Installation</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">How to install dependencies and structure your app.</p>
</a>
</NavigationMenuLink>
<NavigationMenuLink as-child>
<a href="/docs/primitives/typography" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Typography</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Styles for headings, paragraphs, lists...etc</p>
</a>
</NavigationMenuLink>
</div>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuTrigger>Components</NavigationMenuTrigger>
<NavigationMenuContent>
<ul class="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px]">
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/alert-dialog" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Alert Dialog</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">A modal dialog that interrupts the user with important content.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/hover-card" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Hover Card</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">For sighted users to preview content available behind a link.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/progress" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Progress</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Displays an indicator showing the completion progress of a task.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/scroll-area" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Scroll-area</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Visually or semantically separates content.</p>
</a>
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="/docs">
Documentation
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '.'
{
name: 'Showcase',
render: () => ({
components: {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
},
setup() {
return { navigationMenuTriggerStyle }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Navigation Menu with Triggers</h3>
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Products</NavigationMenuTrigger>
<NavigationMenuContent>
<ul class="grid gap-3 p-4 md:w-[400px] md:grid-cols-2">
<li>
<NavigationMenuLink as-child>
<a href="#" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Analytics</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Track and analyze your data.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="#" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Engagement</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Measure and improve engagement.</p>
</a>
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Pricing
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
About
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Simple Links Only</h3>
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Home
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Features
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Pricing
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Contact
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</div>
</div>
`,
}),
}

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport } from './index'
{ render: () => ({ components: { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport }, template: `<NavigationMenu><NavigationMenuList><NavigationMenuItem><NavigationMenuTrigger>Explore</NavigationMenuTrigger><NavigationMenuContent class="p-4"><NavigationMenuLink href="#collections">Collections</NavigationMenuLink></NavigationMenuContent></NavigationMenuItem><NavigationMenuIndicator /></NavigationMenuList><template #viewport><NavigationMenuViewport /></template></NavigationMenu>` }) }
import { NavigationMenuLink } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
activeboolean | undefined—Used to identify the link as the currently active page.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Events​

NameTypeRequired / defaultDescription
select[payload: CustomEvent<{ originalEvent: Event; }>]——

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '.'
{
render: () => ({
components: {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
},
setup() {
return { navigationMenuTriggerStyle }
},
template: `
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Getting Started</NavigationMenuTrigger>
<NavigationMenuContent>
<div class="grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]">
<div class="row-span-3">
<NavigationMenuLink as-child>
<a
class="flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md"
href="/"
>
<div class="mb-2 mt-4 text-lg font-medium">shadcn/ui</div>
<p class="text-sm leading-tight text-muted-foreground">
Beautifully designed components built with Reka UI and Tailwind CSS.
</p>
</a>
</NavigationMenuLink>
</div>
<NavigationMenuLink as-child>
<a href="/docs" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Introduction</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Re-usable components built using Reka UI and Tailwind CSS.</p>
</a>
</NavigationMenuLink>
<NavigationMenuLink as-child>
<a href="/docs/installation" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Installation</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">How to install dependencies and structure your app.</p>
</a>
</NavigationMenuLink>
<NavigationMenuLink as-child>
<a href="/docs/primitives/typography" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Typography</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Styles for headings, paragraphs, lists...etc</p>
</a>
</NavigationMenuLink>
</div>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuTrigger>Components</NavigationMenuTrigger>
<NavigationMenuContent>
<ul class="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px]">
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/alert-dialog" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Alert Dialog</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">A modal dialog that interrupts the user with important content.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/hover-card" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Hover Card</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">For sighted users to preview content available behind a link.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/progress" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Progress</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Displays an indicator showing the completion progress of a task.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/scroll-area" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Scroll-area</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Visually or semantically separates content.</p>
</a>
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="/docs">
Documentation
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '.'
{
name: 'Showcase',
render: () => ({
components: {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
},
setup() {
return { navigationMenuTriggerStyle }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Navigation Menu with Triggers</h3>
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Products</NavigationMenuTrigger>
<NavigationMenuContent>
<ul class="grid gap-3 p-4 md:w-[400px] md:grid-cols-2">
<li>
<NavigationMenuLink as-child>
<a href="#" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Analytics</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Track and analyze your data.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="#" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Engagement</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Measure and improve engagement.</p>
</a>
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Pricing
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
About
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Simple Links Only</h3>
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Home
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Features
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Pricing
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Contact
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</div>
</div>
`,
}),
}

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport } from './index'
{ render: () => ({ components: { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport }, template: `<NavigationMenu><NavigationMenuList><NavigationMenuItem><NavigationMenuTrigger>Explore</NavigationMenuTrigger><NavigationMenuContent class="p-4"><NavigationMenuLink href="#collections">Collections</NavigationMenuLink></NavigationMenuContent></NavigationMenuItem><NavigationMenuIndicator /></NavigationMenuList><template #viewport><NavigationMenuViewport /></template></NavigationMenu>` }) }
import { NavigationMenuList } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '.'
{
render: () => ({
components: {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
},
setup() {
return { navigationMenuTriggerStyle }
},
template: `
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Getting Started</NavigationMenuTrigger>
<NavigationMenuContent>
<div class="grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]">
<div class="row-span-3">
<NavigationMenuLink as-child>
<a
class="flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md"
href="/"
>
<div class="mb-2 mt-4 text-lg font-medium">shadcn/ui</div>
<p class="text-sm leading-tight text-muted-foreground">
Beautifully designed components built with Reka UI and Tailwind CSS.
</p>
</a>
</NavigationMenuLink>
</div>
<NavigationMenuLink as-child>
<a href="/docs" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Introduction</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Re-usable components built using Reka UI and Tailwind CSS.</p>
</a>
</NavigationMenuLink>
<NavigationMenuLink as-child>
<a href="/docs/installation" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Installation</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">How to install dependencies and structure your app.</p>
</a>
</NavigationMenuLink>
<NavigationMenuLink as-child>
<a href="/docs/primitives/typography" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Typography</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Styles for headings, paragraphs, lists...etc</p>
</a>
</NavigationMenuLink>
</div>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuTrigger>Components</NavigationMenuTrigger>
<NavigationMenuContent>
<ul class="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px]">
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/alert-dialog" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Alert Dialog</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">A modal dialog that interrupts the user with important content.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/hover-card" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Hover Card</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">For sighted users to preview content available behind a link.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/progress" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Progress</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Displays an indicator showing the completion progress of a task.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/scroll-area" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Scroll-area</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Visually or semantically separates content.</p>
</a>
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="/docs">
Documentation
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '.'
{
name: 'Showcase',
render: () => ({
components: {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
},
setup() {
return { navigationMenuTriggerStyle }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Navigation Menu with Triggers</h3>
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Products</NavigationMenuTrigger>
<NavigationMenuContent>
<ul class="grid gap-3 p-4 md:w-[400px] md:grid-cols-2">
<li>
<NavigationMenuLink as-child>
<a href="#" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Analytics</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Track and analyze your data.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="#" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Engagement</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Measure and improve engagement.</p>
</a>
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Pricing
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
About
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Simple Links Only</h3>
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Home
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Features
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Pricing
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Contact
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</div>
</div>
`,
}),
}

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport } from './index'
{ render: () => ({ components: { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport }, template: `<NavigationMenu><NavigationMenuList><NavigationMenuItem><NavigationMenuTrigger>Explore</NavigationMenuTrigger><NavigationMenuContent class="p-4"><NavigationMenuLink href="#collections">Collections</NavigationMenuLink></NavigationMenuContent></NavigationMenuItem><NavigationMenuIndicator /></NavigationMenuList><template #viewport><NavigationMenuViewport /></template></NavigationMenu>` }) }
import { NavigationMenuTrigger } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
disabledboolean | undefined—When true, prevents the user from interacting with item
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '.'
{
render: () => ({
components: {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
},
setup() {
return { navigationMenuTriggerStyle }
},
template: `
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Getting Started</NavigationMenuTrigger>
<NavigationMenuContent>
<div class="grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]">
<div class="row-span-3">
<NavigationMenuLink as-child>
<a
class="flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md"
href="/"
>
<div class="mb-2 mt-4 text-lg font-medium">shadcn/ui</div>
<p class="text-sm leading-tight text-muted-foreground">
Beautifully designed components built with Reka UI and Tailwind CSS.
</p>
</a>
</NavigationMenuLink>
</div>
<NavigationMenuLink as-child>
<a href="/docs" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Introduction</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Re-usable components built using Reka UI and Tailwind CSS.</p>
</a>
</NavigationMenuLink>
<NavigationMenuLink as-child>
<a href="/docs/installation" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Installation</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">How to install dependencies and structure your app.</p>
</a>
</NavigationMenuLink>
<NavigationMenuLink as-child>
<a href="/docs/primitives/typography" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Typography</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Styles for headings, paragraphs, lists...etc</p>
</a>
</NavigationMenuLink>
</div>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuTrigger>Components</NavigationMenuTrigger>
<NavigationMenuContent>
<ul class="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px]">
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/alert-dialog" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Alert Dialog</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">A modal dialog that interrupts the user with important content.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/hover-card" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Hover Card</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">For sighted users to preview content available behind a link.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/progress" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Progress</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Displays an indicator showing the completion progress of a task.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="/docs/primitives/scroll-area" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Scroll-area</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Visually or semantically separates content.</p>
</a>
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="/docs">
Documentation
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '.'
{
name: 'Showcase',
render: () => ({
components: {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
},
setup() {
return { navigationMenuTriggerStyle }
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Navigation Menu with Triggers</h3>
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Products</NavigationMenuTrigger>
<NavigationMenuContent>
<ul class="grid gap-3 p-4 md:w-[400px] md:grid-cols-2">
<li>
<NavigationMenuLink as-child>
<a href="#" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Analytics</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Track and analyze your data.</p>
</a>
</NavigationMenuLink>
</li>
<li>
<NavigationMenuLink as-child>
<a href="#" class="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
<div class="text-sm font-medium leading-none">Engagement</div>
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">Measure and improve engagement.</p>
</a>
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Pricing
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
About
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Simple Links Only</h3>
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Home
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Features
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Pricing
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink :class="navigationMenuTriggerStyle()" href="#">
Contact
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</div>
</div>
`,
}),
}

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport } from './index'
{ render: () => ({ components: { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport }, template: `<NavigationMenu><NavigationMenuList><NavigationMenuItem><NavigationMenuTrigger>Explore</NavigationMenuTrigger><NavigationMenuContent class="p-4"><NavigationMenuLink href="#collections">Collections</NavigationMenuLink></NavigationMenuContent></NavigationMenuItem><NavigationMenuIndicator /></NavigationMenuList><template #viewport><NavigationMenuViewport /></template></NavigationMenu>` }) }
import { NavigationMenuViewport } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
forceMountboolean | undefined—Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries.
align"start" | "center" | "end" | undefined—Placement of the viewport for css variables (--reka-navigation-menu-viewport-left, --reka-navigation-menu-viewport-top).
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport } from './index'
{ render: () => ({ components: { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport }, template: `<NavigationMenu><NavigationMenuList><NavigationMenuItem><NavigationMenuTrigger>Explore</NavigationMenuTrigger><NavigationMenuContent class="p-4"><NavigationMenuLink href="#collections">Collections</NavigationMenuLink></NavigationMenuContent></NavigationMenuItem><NavigationMenuIndicator /></NavigationMenuList><template #viewport><NavigationMenuViewport /></template></NavigationMenu>` }) }