Navigation Menu
Horizontal menu bar with disclosure panels.
Import
import { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink } from "@cronus-ui/ui";
npx cronus-ui add navigation-menu
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component NavigationMenuDefault layout:inline style:navigation-menu {
label "Products"
text "Analytics"
text "Docs"
}
page "/audit/navigation-menu/default" type:custom {
use NavigationMenuDefault
}
API Reference
Generated from the component's exported types.
NavigationMenuProps
Extends ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled value. |
defaultValue | string | — | Uncontrolled initial value. |
onValueChange | (value: string) => void | — | Called when the value changes. |
dir | "ltr" | "rtl" | — | Reading direction. Inherits from the document when omitted. |
orientation | "horizontal" | "vertical" | — | — |
delayDuration | number | — | — |
skipDelayDuration | number | — | — |
NavigationMenuListProps
Extends ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | — | Render as the child element via Slot. |
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
NavigationMenuItemProps
Extends ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Item>
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | — | Render as the child element via Slot. |
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
NavigationMenuTriggerProps
Extends ComponentPropsWithoutRef< typeof NavigationMenuPrimitive.Trigger >
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | — | Render as the child element via Slot. |
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
NavigationMenuContentProps
Extends ComponentPropsWithoutRef< typeof NavigationMenuPrimitive.Content >
| Prop | Type | Default | Description |
|---|---|---|---|
forceMount | boolean | — | Keep the node mounted when closed, for exit animation. |
asChild | boolean | — | Render as the child element via Slot. |
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
NavigationMenuLinkProps
Extends ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Link>
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | — | Render as the child element via Slot. |
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
NavigationMenuIndicatorProps
Extends ComponentPropsWithoutRef< typeof NavigationMenuPrimitive.Indicator >
| Prop | Type | Default | Description |
|---|---|---|---|
forceMount | boolean | — | Keep the node mounted when closed, for exit animation. |
className | string | — | Additional class names merged onto the root. |
NavigationMenuViewportProps
Extends ComponentPropsWithoutRef< typeof NavigationMenuPrimitive.Viewport >
| Prop | Type | Default | Description |
|---|---|---|---|
forceMount | boolean | — | Keep the node mounted when closed, for exit animation. |
className | string | — | Additional class names merged onto the root. |