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.
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.
childrenReactNodeA NavigationMenuList of items, each a trigger + content or a plain link.
viewportbooleanShare one animated viewport across items instead of each NavigationMenuContent positioning itself.
Default
true
NavigationMenuLink
asChildbooleanRender your router’s Link while keeping menu semantics.
Accessibility
Built to be keyboard-navigable and screen-reader friendly out of the box.
| Key | Function |
|---|---|
| Tab | Moves between top-level items. |
| Enter | Opens the focused item’s panel. |
| Esc | Closes 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.