Navigation Menu
A site's navigation: links, and triggers that open a panel of links in a card under the bar.
Usage
Examples
Sizes
size steps the triggers and the links in the panels they open, at the same widths: sm 28px triggers with 12px words, base 32px with 14px words (the default) or lg 40px with 16px words, the links 8px, 12px or 16px in; a link in the bar takes a trigger's look at the same size, and each trigger opens its own menu's panel.
Border radius
borderRadius sets the corners of the panel the menu opens on the kit's one scale: none, xs 4px, sm 6px, base 8px, lg 12px (the default) or xl 16px, its links keeping inside them; each trigger opens its own menu's panel.
Active
active marks the link to the current page, held in its tint and read out as the current page, beside links as they are by default.
Viewport
viewport={false} opens each panel in a card of its own right under its trigger, where by default every panel opens in one shared card under the bar.
Indicator
NavigationMenuIndicator draws a small arrow under the open trigger, sliding along the bar as another one opens.
As child
asChild draws a link on your router's own link, here Next's, so it moves between pages without a reload, where by default it is a plain link.
API Reference
NavigationMenu
NavigationMenuProps · components/NavigationMenu/NavigationMenu.types.tsNavigationMenuList
NavigationMenuListProps · takes the props of Radix NavigationMenu.ListNavigationMenuItem
NavigationMenuItemProps · takes the props of Radix NavigationMenu.ItemNavigationMenuTrigger
NavigationMenuTriggerProps · takes the props of Radix NavigationMenu.TriggerNavigationMenuContent
NavigationMenuContentProps · takes the props of Radix NavigationMenu.ContentNavigationMenuViewport
NavigationMenuViewportProps · also takes the props of ComponentProps< typeof Viewport >NavigationMenuLink
NavigationMenuLinkProps · takes the props of Radix NavigationMenu.LinkNavigationMenuIndicator
NavigationMenuIndicatorProps · takes the props of Radix NavigationMenu.IndicatorIt also takes the props of Radix NavigationMenu.Root.