Skip to content

Components

NavigationMenu

Component reference

Properties

Use NavigationMenu

Site navigation with direct links and expandable groups of destinations.

Example import style
navigation-menu.tsxTSX
"use client";

import { FloodRoot, NavigationMenu } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <NavigationMenu label="Main navigation" currentHref="/" items={[{ id: "home", label: "Home", href: "/" }, { id: "library", label: "Library", links: [{ id: "components", label: "Components", href: "/components" }] }]} />
    </FloodRoot>
  );
}

Design notes

  • Use stable IDs and real destinations. Set currentHref from the host's route.
  • Tab reaches the open group's links in document order. Escape closes the group and returns focus to its trigger.
  • Use Menu or Menubar for app commands. Keep the navigation surface clear of clipping ancestors.

API reference

PropValuesDefault
labelstringRequired
itemsreadonly NavigationMenuItem[]Required
currentHrefstring—
size"2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl""md"
Native HTML propsOmit<HTMLAttributes<HTMLElement>, "children" | "role" | "aria-label">Forwarded
View TypeScript source