---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Navigation menu

A site's header menu: a row of links and triggers, each trigger opening a panel of links, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `NavigationMenu`.

## Try it

Open Product or Resources by pointing or by the keys and move along the row to turn the panel; follow a link to mark its page current.

The pages are our own; a link marks its page here instead of leaving.

## When to use

- A site's header menu: a row of links and triggers, each trigger opening a panel of links.
- Also called: nav menu or mega menu.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Navigation menu on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-navigation-menu.json --yes
```

```text
Add the Goop Navigation menu to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import {
  NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuRow,
} from '@/components/ui/goop/navigation-menu';

<NavigationMenu aria-label="Site">
  <NavigationMenuList>
    <NavigationMenuItem>
      <NavigationMenuTrigger>Product</NavigationMenuTrigger>
      <NavigationMenuContent>
        <NavigationMenuRow
          href="/notebook"
          icon="file"
          title="Interview notebook"
          description="Recordings, transcripts and notes in one place"
        />
        <NavigationMenuRow href="/search" icon="search" title="Transcript search" description="Find a quote in every study" />
      </NavigationMenuContent>
    </NavigationMenuItem>
    <NavigationMenuItem>
      <NavigationMenuLink href="/pricing" active>
        Pricing
      </NavigationMenuLink>
    </NavigationMenuItem>
  </NavigationMenuList>
</NavigationMenu>
```

- Fits: frame (its recipe); frame: top-nav.
- Also known as: MegaMenu, SiteNav, HeaderNav, NavMenu, Navbar.
- It is the header's middle in a site's top bar; an app's own pages go in the Sidebar instead. Mark the page shown with `active` on its link or row.
- height, width, padding, gap, corner, border, background, shadow, text, motion: add no class for these.

## API reference

### Options

- `menuLabel?: string = 'Menu'` — The phone's menu button's name and its sheet's title, the caller's to translate.
- `menuOpen?: boolean` — The phone's sheet open, held by the caller (close it on a route change).
- `defaultMenuOpen?: boolean` — The phone's sheet open at first.
- `onMenuOpenChange?: (open: boolean) => void` — Called when the phone's sheet opens or closes.
- `container?: HTMLElement | null` — Where the phone's sheet is put: the end of `<body>` by default.
- `Defaults: aria-label = 'Main'; delayDuration = 200`

- State: menuOpen (menuOpen / defaultMenuOpen / onMenuOpenChange); drawn by data-state=open

### Parts

- `NavigationMenuList` — The row of items
- `NavigationMenuItem` — One item of the row
- `NavigationMenuTrigger` — The trigger that opens its item's panel
- `NavigationMenuContent` — The panel a trigger opens; columns?: 1 | 2 = 1 — One column of rows (the default) or two
- `NavigationMenuLink` — A top-level link in the row (a page with no panel: Pricing, Docs), the triggers' look; `active` marks the page shown (`aria-current="page"`, the deeper current fill); takes asChild
- `NavigationMenuRow` — A row of a panel; takes asChild; title: string — The page's name, the row's words; description?: string — One line about the page, under its name; icon?: IconName — A 16 px pack icon before the words, by the pack's name; children?: ReactElement — With `asChild`, the caller's one link element the row is drawn on (a router's link)

## Keyboard

- Tab: move through the triggers and links of the row
- Enter / Space: open or shut the focused trigger's panel
- ArrowDown: open the focused trigger's panel and move into it
- ArrowLeft / ArrowRight: move between the triggers and links of the row, and between a panel's rows
- Escape: shut the panel and return to its trigger

## Accessibility

- The behaviour layer under the part answers keys, focus and dismissal: never write your own.
- hover, focus, focus-visible: the browser's own (:hover, :focus, :focus-visible): write nothing
- expanded: the attribute data-state=open
- open: the attribute data-state=open
- current: the attribute aria-current=page

## Motion

- The part sets its own motion: add no transition or animation of your own.

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

Shortened to fit: the data-slot values.

## Related

- [Steps](/themes/trail/components/steps): A strip that shows which step of a flow the user is on, for display only.
- [Tree view](/themes/trail/components/tree-view): Nested rows a person opens and closes, to pick one (or several) of them.
- [Filter chips](/themes/trail/components/filter-chips): The row of filters applied to a list, under its filter controls.
- [Contents nav](/themes/trail/components/contents-nav): A table of contents for a long reading page (an article, a guide, a help page), each link jumping to a section.
