# NavigationMenu

Site navigation with direct links and expandable groups of destinations.

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"use client";

import { FloodRoot, NavigationMenu } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <NavigationMenu label="Main navigation" currentHref="/" items={[{ id: "home", label: "Home", href: "/" }, { id: "library", label: "Library", links: [{ id: "components", label: "Components", href: "/components" }] }]} />
    </FloodRoot>
  );
}
```

## Design notes

- Use stable IDs and real destinations. Set currentHref from the host's route.
- Tab reaches the open group's links in document order. Escape closes the group and returns focus to its trigger.
- Use Menu or Menubar for app commands. Keep the navigation surface clear of clipping ancestors.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `label` | `string` | `Required` |
| `items` | `readonly NavigationMenuItem[]` | `Required` |
| `currentHref` | `string` | `—` |
| `size` | `"2xs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl"` | `"md"` |
| `Native HTML props` | `Omit<HTMLAttributes<HTMLElement>, "children" \| "role" \| "aria-label">` | `Forwarded` |
