npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-navigation-menu.json --yesNavigation menu
ProA site's header menu, for React and Tailwind CSS. Part of Goop Pro.
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuRow,
NavigationMenuTrigger,
} from '@/components/ui/goop/navigation-menu';
function SiteMenu() {
return (
<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>
);
}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.
- 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.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-navigation-menu.json --yesAdd the Goop Navigation menu to this project. The install steps are at https://goop.so/docs/install.mdUsage
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuRow,
NavigationMenuTrigger,
} from '@/components/ui/goop/navigation-menu';
function SiteMenu() {
return (
<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: 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
activeon its link or row. - height, width, padding, gap, corner, background, shadow, text, motion: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| 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-focus-visible, data-state=open
| Part | What it is |
|---|---|
| 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 grey wash and the text colour); 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
| Key | What it does |
|---|---|
| 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: the browser's own (:hover): write nothing
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| focus-visible | the attribute data-focus-visible |
| 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.