Your next page is taking shape...

Opening Your Next Page…

Loading the guide and preparing its examples for you to explore. The page will appear here automatically when it’s ready, so you can keep this view open without refreshing.

Made for Preact. Built to be yours.

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


Interactive Live Preview
Try it. Make it yours.

Installation

Import NavigationMenu primitives and optional navigationMenuTriggerStyle from @/components/kamod-ui/navigation-menu.

Install PackagesTerminal
pnpm add @kamod-ch/ui

Copy 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 SetupTypeScript
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.

src/components/NavigationMenuExample.tsx1 line
// See shadcn NavigationMenuDemo — ListItem helper + components grid + navigationMenuTriggerStyle on Docs link

Basic

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.

Interactive Live Preview
Try it. Make it yours.

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.

Interactive Live Preview
Try it. Make it yours.
API reference

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.

API reference
Your API, from source

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

Read each option with its owning component. The
marker identifies required fields verified in that declaration. A ? 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.
@kamod-ch/ui/navigation-menu26.1 KB min · 6.7 KB gzipSignals: direct@preact/signals

NavigationMenu

NavigationMenuProps

NavigationMenu documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildNavigationMenuProps

Configure children for NavigationMenu. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>NavigationMenuProps

Configure class for NavigationMenu. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
delayDuration
numberNavigationMenuProps

Delay before opening a submenu on hover (ms).

Default
200
dir
"rtl" | "ltr" | (SignalLike<"auto" | "rtl" | "ltr" | undefined> & "rtl") | (SignalLike<"auto" | "rtl" | "ltr" | undefined> & "ltr")NavigationMenuProps

Passed to the root `nav` for RTL.

Default
—
skipDelayDuration
numberNavigationMenuProps

After opening, subsequent opens skip the delay for this many ms.

Default
300

NavigationMenuContent

NavigationMenuContentProps

NavigationMenuContent documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildNavigationMenuContentProps

Configure children for NavigationMenuContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>NavigationMenuContentProps

Configure class for NavigationMenuContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onPointerEnter
PointerEventHandler<HTMLDivElement>NavigationMenuContentProps

Configure onPointerEnter for NavigationMenuContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onPointerLeave
PointerEventHandler<HTMLDivElement>NavigationMenuContentProps

Configure onPointerLeave for NavigationMenuContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

NavigationMenuItem

NavigationMenuItemProps

NavigationMenuItem documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildNavigationMenuItemProps

Configure children for NavigationMenuItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>NavigationMenuItemProps

Configure class for NavigationMenuItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
value
stringNavigationMenuItemProps

Stable id for this branch; auto-generated when omitted.

Default
—

NavigationMenuList

NavigationMenuListProps

NavigationMenuList documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildNavigationMenuListProps

Configure children for NavigationMenuList. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>NavigationMenuListProps

Configure class for NavigationMenuList. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

NavigationMenuTrigger

NavigationMenuTriggerProps

NavigationMenuTrigger documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildNavigationMenuTriggerProps

Configure children for NavigationMenuTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>NavigationMenuTriggerProps

Configure class for NavigationMenuTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onClick
MouseEventHandler<HTMLButtonElement>NavigationMenuTriggerProps

Configure onClick for NavigationMenuTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onPointerEnter
PointerEventHandler<HTMLButtonElement>NavigationMenuTriggerProps

Configure onPointerEnter for NavigationMenuTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onPointerLeave
PointerEventHandler<HTMLButtonElement>NavigationMenuTriggerProps

Configure onPointerLeave for NavigationMenuTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

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 fields
NavigationMenuProps
Exported Source Declaration from NavigationMenu.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 field
NavigationMenuContentProps
Exported Source Declaration from NavigationMenuContent.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 fields
NavigationMenuItemProps
Exported Source Declaration from NavigationMenuItem.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of NavigationMenuItemProps before adapting it.
3 declared fields
NavigationMenuLinkProps
Exported Source Declaration from NavigationMenuLink.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 field
NavigationMenuListProps
Exported Source Declaration from NavigationMenuList.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 field
NavigationMenuTriggerProps
Exported Source Declaration from NavigationMenuTrigger.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 fields
NavigationMenuRootContextValue
Exported Source Declaration from navigation-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.
Required fields
openValue, delayDuration, skipDelayDuration, rootRef, openTimerRef, closeTimerRef, lastOpenAtRef, requestOpen, requestClose, clearTimers, toggleItem
NavigationMenuItemContextValue
Exported Source Declaration from navigation-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.
Required fields
value

Accessibility

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.

  1. Reach all destinations without a pointer, then close the panel and continue through the page.
  2. Check the current link and disclosure state after route changes.
  3. 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.

Take the Next Useful Step

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.