NavigationMenu

Site navigation with links and dropdown panels.

Base UI Navigation MenuSource

Surfaces

Use raised on the window background, plain inside a card, and outlined in a Section or other flat region. Each Trigger opens its Content in one shared Popup.

raised · on window
outlined · flat region
plain · in a card

Usage

These are defaults, not laws. Break one when you have a good reason, or when it makes the design more cohesive or more interesting.

  • Use NavigationMenu for site navigation. For app commands, use Menubar.
  • For an internal link, pass render={<GatsbyLink to="/path" />} to NavigationMenu.Link. components/Link does not forward a ref.

API

Props that the library adds. Every part also takes all the Base UI props.

NavigationMenu.List

PropTypeDefaultDescription
appearance'plain' | 'outlined' | 'raised''raised'Sets the list surface. Raised adds a translucent fill and a shadow.

NavigationMenu.Link

PropTypeDefaultDescription
closeOnClickbooleantrueCloses the menu when the user clicks the link. The Base UI default is false.

NavigationMenu.Popup

PropTypeDefaultDescription
align'start' | 'center' | 'end''start'Aligns the popup with the start edge of the open trigger. The Base UI default is center.
sideOffsetnumber4The gap between the list and the popup, in pixels.
collisionAvoidanceCollisionAvoidance{ side: 'none' }The popup stays below the list. It does not flip to the other side.
containerHTMLElement | ShadowRoot | RefObject | null–The element that the popup renders into. The default is the document body.