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 commitfc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.
NavigationMenu
import { NavigationMenu } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
modelValue | string | undefined | — | The controlled value of the menu item to activate. Can be used as v-model. |
defaultValue | string | 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. |
dir | Direction$3 | undefined | — | The reading direction of the combobox when applicable. If omitted, inherits globally from ConfigProvider or assumes LTR (left-to-right) reading mode. |
orientation | Orientation | undefined | — | The orientation of the menu. |
delayDuration | number | undefined | — | The duration from when the pointer enters the trigger until the tooltip gets opened. |
skipDelayDuration | number | undefined | — | How much time a user has to enter another trigger without incurring a delay again. |
disableClickTrigger | boolean | undefined | — | If true, menu cannot be open by click on trigger |
disableHoverTrigger | boolean | undefined | — | If true, menu cannot be open by hover on trigger |
disablePointerLeaveClose | boolean | undefined | — | If true, menu will not close during pointer leave event |
unmountOnHide | boolean | undefined | — | When true, the element will be unmounted on closed state. |
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
update:modelValue | [value: string] | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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>` }) }
NavigationMenuContent
import { NavigationMenuContent } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
forceMount | boolean | undefined | — | Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries. |
disableOutsidePointerEvents | boolean | 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. |
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
escapeKeyDown | [event: KeyboardEvent] | — | — |
pointerDownOutside | [event: PointerDownOutsideEvent] | — | — |
focusOutside | [event: FocusOutsideEvent] | — | — |
interactOutside | [event: PointerDownOutsideEvent | FocusOutsideEvent] | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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>` }) }
NavigationMenuIndicator
import { NavigationMenuIndicator } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
forceMount | boolean | undefined | — | Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries. |
asChild | boolean | 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. |
as | AsTag | 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>` }) }
NavigationMenuItem
import { NavigationMenuItem } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
value | string | 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. |
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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>` }) }
NavigationMenuLink
import { NavigationMenuLink } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
active | boolean | undefined | — | Used to identify the link as the currently active page. |
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
select | [payload: CustomEvent<{ originalEvent: Event; }>] | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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>` }) }
NavigationMenuList
import { NavigationMenuList } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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>` }) }
NavigationMenuTrigger
import { NavigationMenuTrigger } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
disabled | boolean | undefined | — | When true, prevents the user from interacting with item |
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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>` }) }
NavigationMenuViewport
import { NavigationMenuViewport } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
forceMount | boolean | 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). |
asChild | boolean | 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. |
as | AsTag | 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>` }) }