Examples
Usage
import { Menu } from "@phuctech/ui/components/menu";
<Menu label="Workspace navigation" items={items} currentPath="/projects" />Menu is a persistent navigation landmark. Give every item a stable ID and either an href or child destinations. Use DropdownMenu for contextual actions.
Keyboard behavior
Tab enters the roving sequence once. Up/Down and Home/End move between visible enabled actions. Right expands a branch, and Left collapses it or focuses its parent. Ordinary links remain links, and the current route receives aria-current="page".
API
Accessibility
The root is a named nav landmark with nested lists, links, and disclosure buttons. Every disclosure action has a branch-specific name and expanded state. Disabled links are removed from roving keyboard focus.
Related
- DropdownMenu presents actions in a temporary popup.
- Breadcrumb identifies the current path hierarchy.
- Drawer can host this navigation on narrow screens.