# NavigationMenu

> A horizontal row of triggers that each open a rich, multi-column panel below the row — disclosure-pattern site navigation, not an application menu.

- Package: `fancy-ui-react` (React 18/19 + Tailwind CSS v4)
- Category: Navigation
- Tags: navigation, menu, disclosure, mega menu, dropdown, header
- Types: `NavigationMenuProps`, `NavigationMenuListProps`, `NavigationMenuItemProps`, `NavigationMenuTriggerProps`, `NavigationMenuContentProps`, `NavigationMenuLinkProps`, `NavigationMenuContext`, `NavigationMenuItemContext`
- Docs: https://fancy-ui.rama.app/docs/components/navigation-menu
- Source: https://github.com/RamaHerbin/fancy-ui/tree/main/react/src/components/navigation-menu

## Import

```tsx
import { NavigationMenu } from 'fancy-ui-react';
```

Setup (once per project): `npm install fancy-ui-react`, then put these lines in your main CSS file (the stylesheet import goes right after `@import "tailwindcss";`):

```css
@import "tailwindcss";
@import "fancy-ui-react/tailwind.css";
```

and import the component styles once in the app entry: `import "fancy-ui-react/styles.css";`. Full guide: https://fancy-ui.rama.app/llms.txt

The names below are the ones to write in React; when one differs from the Svelte name, the Svelte name follows in parentheses. `class` becomes `className`, a callback takes the name the React port declares (`onclick` becomes `onClick`), snippets become `ReactNode` props (render functions when they take arguments) and the default snippet is `children`. Divergences: https://github.com/RamaHerbin/fancy-ui/tree/main/react#divergences-from-the-svelte-api

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `string` | `""` | The open item's value, bindable. Empty string when every panel is closed. |
| `onValueChange` | `(value: string) => void` | — | Called whenever the open item changes, from any trigger. |
| `label` | `string` | `"Main"` | Accessible name for the nav landmark. |
| `openDelay` | `number` | `150` | Delay in ms before a hovered trigger opens its panel. |
| `closeDelay` | `number` | `200` | Delay in ms before a panel closes after the pointer leaves it and its trigger. |
| `className` (Svelte `class`) | `string` | — | Additional CSS classes for the nav. |
| `ref` | `HTMLElement \| null` | `null` | Bindable reference to the nav element. |

## Node props

| Prop | Description |
| --- | --- |
| `children` | Typically a single NavigationMenuList. Snippet<[]> — the compound's own sub-components (NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink) are exported from the same module and used inside it. |

## Example

```tsx
import {
	NavigationMenu,
	NavigationMenuContent,
	NavigationMenuItem,
	NavigationMenuLink,
	NavigationMenuList,
	NavigationMenuTrigger,
} from "fancy-ui-react";

export function NavigationMenuExample() {
	return (
		<NavigationMenu label="Product">
			<NavigationMenuList>
				<NavigationMenuItem value="products">
					<NavigationMenuTrigger>Products</NavigationMenuTrigger>
					<NavigationMenuContent>
						<NavigationMenuLink href="#components" className="ft-navigation-menu-feature">
							<div className="text-[13px] font-semibold">Components</div>
							<span className="text-muted-foreground text-[11px]">Browse the full UI library</span>
						</NavigationMenuLink>
						<div className="flex flex-col gap-0.5">
							<NavigationMenuLink
								href="#themes"
								title="Themes"
								description="Generate custom color palettes"
							/>
							<NavigationMenuLink
								href="#templates"
								title="Templates"
								description="Ready-to-use page starters"
							/>
						</div>
					</NavigationMenuContent>
				</NavigationMenuItem>

				<NavigationMenuItem value="resources">
					<NavigationMenuTrigger>Resources</NavigationMenuTrigger>
					<NavigationMenuContent>
						<NavigationMenuLink href="#docs" className="ft-navigation-menu-feature">
							<div className="text-[13px] font-semibold">Documentation</div>
							<span className="text-muted-foreground text-[11px]">Guides and API reference</span>
						</NavigationMenuLink>
						<div className="flex flex-col gap-0.5">
							<NavigationMenuLink
								href="#changelog"
								title="Changelog"
								description="What shipped recently"
							/>
							<NavigationMenuLink
								href="#support"
								title="Support"
								description="Get help from the community"
							/>
						</div>
					</NavigationMenuContent>
				</NavigationMenuItem>

				<li>
					<a
						href="#pricing"
						className="text-muted-foreground hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-[8px] px-[14px] py-[8px] text-[13px] font-medium no-underline transition-colors"
					>
						Pricing
					</a>
				</li>
			</NavigationMenuList>
		</NavigationMenu>
	);
}
```
