# NavigationMenu

> Top-level navigation with dropdown link panels.

- Category: [Navigation](https://tarve.dev/docs.md#navigation)
- Import: `import { NavigationMenu } from "@tarve/core";`
- Props type: `NavigationMenuProps`
- Source: [packages/core/src/advanced-controls.ts:144](https://github.com/omarcosr/tarve/blob/main/packages/core/src/advanced-controls.ts#L144)

## Usage

```tsx title="NavigationMenu.tsx"
import { NavigationMenu } from "@tarve/core";

let value = "start";
let openValue: string | undefined = "docs";

<NavigationMenu
  value={value}
  openValue={openValue}
  items={[
    {
      value: "docs",
      label: "Docs",
      links: [
        { value: "start", label: "Getting started", description: "Install and run your first window." },
        { value: "components", label: "Components", description: "Every built-in control." },
      ],
    },
    { value: "blog", label: "Blog" },
  ]}
  onValueChange={(next) => {
    value = next;
  }}
  onOpenValueChange={(next) => {
    openValue = next;
  }}
/>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` (required) | `readonly NavigationMenuItem[]` | — |  |
| `onOpenValueChange` | `(value: string \| undefined) => void` | — |  |
| `onValueChange` | `(value: string) => void` | — |  |
| `openValue` | `string` | — |  |
| `value` | `string` | — |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

## Types

```ts title="NavigationMenuItem"
interface NavigationMenuItem {
  value: string;
  label: string;
  disabled?: boolean;
  links?: readonly NavigationMenuLink[];
}
```

Previous: [Pagination](https://tarve.dev/docs/components/Pagination.md) · Next: [Menubar](https://tarve.dev/docs/components/Menubar.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/NavigationMenu · Index for agents: https://tarve.dev/llms.txt
