codefast/ui

Command Palette

Search for a command to run...

Source
Navigation

Navigation Menu

Animated mega-menu with animated content panels. Built on Radix NavigationMenu.

Examples

Anatomy

How the parts nest — every slot the component exposes, in composition order.

NavigationMenu
└── NavigationMenuList
└── NavigationMenuItem
├── NavigationMenuTrigger
└── NavigationMenuContent

Features

  • viewport (default true) makes every item share one animated panel that resizes to fit the open content; set viewport={false} to render each NavigationMenuContent inline instead.
  • NavigationMenuIndicator draws a small arrow that tracks the active trigger.

API reference

Props for each part of the component. All native element props are also forwarded.

NavigationMenu

Site navigation with animated content panels.

childrenReactNode

A NavigationMenuList of items, each a trigger + content or a plain link.

viewportboolean

Share one animated viewport across items instead of each NavigationMenuContent positioning itself.

Defaulttrue

NavigationMenuLink

asChildboolean

Render your router’s Link while keeping menu semantics.

Accessibility

Built to be keyboard-navigable and screen-reader friendly out of the box.

KeyFunction
TabMoves between top-level items.
EnterOpens the focused item’s panel.
EscCloses the open panel.
  • Implements the ARIA navigation pattern; panels open on hover and focus.
  • Use real links inside; render router Links via asChild.
  • Touch users can’t hover — ensure links are reachable by tap too.

Guidelines

Conventions that keep usage consistent across an app.

Do

  • Use for primary site navigation with grouped destinations.
  • Keep panels shallow and scannable.

Don’t

  • Don’t put forms or complex controls in a nav panel.
  • Don’t bury key links several levels deep.

Explore further

Ready to integrate?

Follow the Getting Started guide to install @codefast/ui, or browse the full component gallery.