Navigation & Disclosure
Navigation Menu
Hierarchical top-level navigation with hover and click, aligned with shadcn/ui patterns. Organize content into understandable destinations and reveal detail when it becomes relevant. Keep the active location or expanded state easy to recognize. Import it from @/components/kamod-ui/navigation-menu.
Source · Design reference · API reference · Theming · Styles
Installation
Import NavigationMenu primitives and optional navigationMenuTriggerStyle from @/components/kamod-ui/navigation-menu.
pnpm add @kamod-ch/uiCopy an example with @kamod-ch/ui or the matching @kamod-ch/ui/… subpath. The code block switches between those two installs. Connect The Global Theme CSS and Tailwind Source Detection before your first render.
Usage
Wrap each branch in NavigationMenuItem. Pair NavigationMenuTrigger with NavigationMenuContent for flyouts; use NavigationMenuLink with navigationMenuTriggerStyle() for a top-level link that matches trigger styling. Submenus share one open panel with delay and skip-delay behavior similar to Radix.
import { NavigationMenu } from "@kamod-ch/ui";Choose a complete composition from the examples below; required child components and props vary by pattern.
Component Examples & Variants
Explore Navigation Menu in Different Contexts, from the starting pattern to the compositions below. Begin with Demo, then compare the examples that match your content, state and layout. These are working patterns to adapt, not a list of interchangeable variant values: check the API Reference before using a prop or combining behaviors. Look at the surrounding labels, supporting text and spacing as well as the component itself.
Read the Result and Its Implementation Together. Use each showcase’s Code view to inspect imports and composition, or its Prompt view to prepare a setup or adaptation brief. Try the narrow preview and local theme controls before connecting real data, and use Reset to return an example to its initial state. Keep layout changes in class utilities where appropriate; follow the Component Styles Guide for hierarchy and the Theming Guide for shared surfaces and colors. The Accessibility Notes explain what to preserve when making those changes.
Demo
Group Destinations Around How People Explore the Site. Compose introductory links, a responsive component grid and a direct documentation destination within one navigation menu. The example shows how dropdown content and ordinary links can share a visual hierarchy without behaving identically.
Keep destination labels specific, preserve ordinary anchor behavior and provide a responsive navigation alternative when the full panel layout no longer fits.
// See shadcn NavigationMenuDemo — ListItem helper + components grid + navigationMenuTriggerStyle on Docs linkBasic
Start with One Clearly Named Navigation Group. Start with one NavigationMenuTrigger and its associated content inside the menu list. This establishes the expandable navigation relationship before adding multi-column collections, descriptions or standalone destinations.
Keep the list short enough to scan and test keyboard opening, movement and dismissal before adding richer panel content.
Link with Trigger Style
Make Direct Destinations Fit Beside Expandable Groups. Apply navigationMenuTriggerStyle() to NavigationMenuLink when a direct destination should visually align with neighboring dropdown triggers. The element remains a link, so matching its appearance does not imply that it opens another panel.
Keep its destination real and avoid presenting a disclosure indicator when there is no panel; consistent styling should not imply identical interaction.
Delay Tuning
Tune Hover Behavior for Real Pointer Travel. Tune the opening delay and the rapid-switch skip window when moving between adjacent menus. These timing options affect how hover navigation feels; they should leave deliberate keyboard and pointer selection predictable.
Test the menu with its actual spacing and panel sizes, and retain keyboard access independently of the pointer timing choices.
Props and Data
Configure Navigation Menu using the contracts below. Read the documented options alongside the Source Definitions to understand which values your application supplies and which details the component owns. Start with a prop or helper, then follow its type link to inspect the declaration without leaving the page.
Props, slots and variants for this component.
Type cards are extracted from this checkout’s TypeScript source at build time. Props inherited through HTMLAttributes, Omit or variant helpers remain references in those declarations; their fields are not flattened here. Match the reference to your installed version, and check a package’s exports before writing an import type. A type exported by a source file is not necessarily re-exported by @kamod-ch/ui.
Component Props
? means a field can be omitted; it does not promise a fallback value. Existing documented defaults remain alongside the descriptions. For callbacks, check the argument and return types before connecting your own state or services.Data Type Reference
Expand a card to inspect and copy the exact declaration. The code header identifies its repository file; follow imported or inherited types in the Implementation Source when you need the complete dependency chain. Required-field summaries cover fields declared directly in that type. Source-only helpers and inferred schema outputs describe the local implementation, not additional props you can pass to every component.
NavigationMenu Props
4 declared fieldsNavigationMenuPropsNavigationMenu.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of NavigationMenuProps before adapting it.NavigationMenuContent Props
1 declared fieldNavigationMenuContentPropsNavigationMenuContent.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of NavigationMenuContentProps before adapting it.NavigationMenuItem Props
2 declared fieldsNavigationMenuItemPropsNavigationMenuItem.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of NavigationMenuItemProps before adapting it.NavigationMenuLink Props
3 declared fieldsNavigationMenuLinkPropsNavigationMenuLink.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of NavigationMenuLinkProps before adapting it.NavigationMenuList Props
1 declared fieldNavigationMenuListPropsNavigationMenuList.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of NavigationMenuListProps before adapting it.NavigationMenuTrigger Props
1 declared fieldNavigationMenuTriggerPropsNavigationMenuTrigger.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of NavigationMenuTriggerProps before adapting it.NavigationMenuRootContextValue
11 declared fieldsNavigationMenuRootContextValuenavigation-menu-context.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of NavigationMenuRootContextValue before adapting it.openValue, delayDuration, skipDelayDuration, rootRef, openTimerRef, closeTimerRef, lastOpenAtRef, requestOpen, requestClose, clearTimers, toggleItemNavigationMenuItemContextValue
1 declared fieldNavigationMenuItemContextValuenavigation-menu-context.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of NavigationMenuItemContextValue before adapting it.valueAccessibility
Build the Complete Interaction, Including the Parts Outside Navigation Menu. The notes below distinguish the current implementation from the labels, content and behavior your application supplies. Start with the Live Preview, check the Props and Data Reference, and test the finished composition with real content rather than assuming that an unchanged visual example covers every use case.
Built-in Behavior and Defaults
NavigationMenu is navigation with button disclosures and links. Triggers expose expanded state; active links can expose aria-current="page". This site-navigation pattern should not be confused with an application menubar merely because it has dropdown panels.
Labels and Relationships
Give the navigation landmark a useful name and use descriptive destination text. A trigger should identify the group it reveals. Keep a real overview link separate when the same group also has a landing page.
Keyboard and Focus
Verify Tab order through triggers, revealed links and subsequent page content. Escape and outside dismissal should follow the component's behavior. Preserve a sensible trigger destination for focus when a panel closes.
States and Integration Details
Do not make a hover-only panel the sole path to a destination. Avoid nesting anchors inside buttons, and keep expanded panels usable when text grows or the viewport becomes narrower.
Verify the Complete Interaction
Check Behavior as Well as Markup. Work through these scenarios in the application where the component will be used. Automated checks can help find structural problems; also review the reading experience with a screen reader, keyboard focus and the actual feedback from your application.
- Reach all destinations without a pointer, then close the panel and continue through the page.
- Check the current link and disclosure state after route changes.
- Try touch input, long link names and a keyboard-open panel at small widths.
Recheck the result after changing Theme Tokens, translations or class overrides. Include text enlargement, narrow layouts and reduced-motion settings where animation is present. Inspect the Component Source when a behavior differs from your expectation; a role or state attribute does not implement keyboard interaction by itself.
For background, read the WAI-ARIA Authoring Guidance and Keyboard Interface Guidance. These explain the patterns; verify browser and assistive-technology behavior for the implementation and audience you actually support.
You have the pieces. Put them into one real interaction, keep its state in one place, and check the result with the content your application will actually show.
Connect the Foundation
Return to Choose and Compose Components to connect this reference to a working screen. Keep global CSS in one entrypoint and import only the components that screen needs.
Build the Surrounding Screen
Find a neighboring interaction in the Component Library, or start with a complete Block. Replace sample content and destinations before refining the layout; a local class change can stay with the composition.
Make the Result Hold Up
Use shared theme roles for changes that belong everywhere. Then review the whole journey: keyboard focus, long labels, narrow screens and a clear way to recover when something fails.
Keep a link to the source and note your intentional changes. Your next edit should begin with a clear decision, not another search.