Navigation Menu

Flexible navigation surface with dropdown popups for grouped links.

Overview

NavigationMenu builds an accessible navigation bar with top-level links, triggers, and floating popup content. The trigger and top-level link styles use Cubitt link-button behavior, while popup links use menu-style contextual hover states.

Popup content is surface-aware: the popup lands at parent +2, its border and arrow edge match that surface level, and links inside the popup highlight at the next surface level.

Usage

import {
  NavigationMenu,
  NavigationMenuArrow,
  NavigationMenuContent,
  NavigationMenuItem,
  NavigationMenuLink,
  NavigationMenuList,
  NavigationMenuPopup,
  NavigationMenuPositioner,
  NavigationMenuTrigger,
} from "@tilt-legal/cubitt-components/navigation-menu";
<NavigationMenu>
  <NavigationMenuList>
    <NavigationMenuItem>
      <NavigationMenuLink href="#">About</NavigationMenuLink>
    </NavigationMenuItem>
    <NavigationMenuItem>
      <NavigationMenuTrigger>Resources</NavigationMenuTrigger>
      <NavigationMenuContent>
        <NavigationMenuLink href="#">Docs</NavigationMenuLink>
      </NavigationMenuContent>
    </NavigationMenuItem>
  </NavigationMenuList>

  <NavigationMenuPositioner>
    <NavigationMenuPopup>
      <NavigationMenuArrow />
    </NavigationMenuPopup>
  </NavigationMenuPositioner>
</NavigationMenu>

Examples

Basic

API Reference

PropTypeDefaultDescription
delaynumber0Delay before opening popup content.
closeDelaynumber0Delay before closing popup content.
classNamestringAdditional classes for the root.
childrenReactNodeMenu list and popup positioner pieces.
PropTypeDefaultDescription
classNamestringAdditional classes for the list.
childrenReactNodeNavigation menu items.
PropTypeDefaultDescription
classNamestringAdditional classes for the item.
childrenReactNodeTrigger, link, or content children.
PropTypeDefaultDescription
showChevronbooleanfalseShow a rotating chevron beside the label.
classNamestringAdditional classes for the trigger.
childrenReactNodeTrigger content.
PropTypeDefaultDescription
classNamestringAdditional classes for the content transition.
childrenReactNodeContent rendered into the popup viewport.

Top-level links render with link-button styling. Links inside NavigationMenuContent render with menu-item hover behavior.

PropTypeDefaultDescription
hrefstringLink destination.
activebooleanfalseMarks the link as representing current page.
classNamestringAdditional classes for the link.
childrenReactNodeLink content.
PropTypeDefaultDescription
sideOffsetnumber10Distance from trigger in pixels.
collisionPadding{ top, bottom, left, right }{ top: 5, bottom: 5, left: 20, right: 20 }Viewport padding for collision handling.
classNamestringAdditional classes for the positioner.
childrenReactNodePopup component.
PropTypeDefaultDescription
classNamestringAdditional classes for the popup.
childrenReactNodePopup adornments, usually the arrow.
PropTypeDefaultDescription
classNamestringAdditional classes for the arrow.

On this page