DocsPlatform

NavigationMenu

Site navigation with flyout panels. Open state can be null, meaning nothing is open at all. Triggers with no panel behind them are guarded so they cannot open one, and hover intent is delayed so brushing past a trigger does not fire it. Submenu geometry is shared with the other menu components. All four layers share the one behaviour contract.

Live machine

The shipped navigationMenuMachine. Panel ownership is input data — the middle trigger is a plain link, so CLICK on it never opens a panel.

navigation-menu · live via createService

States · walked from the machine

ready

Transitions from here · click to send

Context

{
  "open": null,
  "mode": "uncontrolled"
}

Log · newest first

No events yet — use the component above or send a transition.

The layers

Machine is pure state with no DOM. Headless maps that state to framework-native anatomy and ARIA. Styled keeps the existing Grassroot visual recipe while delegating behaviour. Vanilla mounts the same headless contract without a framework.

Behaviour contract

The machine owns panel ownership, click/hover/focus intent, nullable open binding, and safe-triangle preservation. Adapters translate DOM events and render machine snapshots. Not one of them keeps a second reducer or re-filters the collection behind your back.

  • Controlled bindings emit serialisable change requests, and only adopt the parent's state once it comes back in through input.
  • Uncontrolled bindings commit straight to machine state, and still emit the same request object, so a consumer can watch either way.
  • Keyboard, pointer, focus, dismissal, and accessibility behaviour are shared across vanilla, React, Vue, Solid, Svelte, and Angular.

Evidence

The authoritative source files are:

  • packages/ui-machines/src/navigation-menu/index.ts
  • packages/ui-headless/core/src/navigation-menu/navigation-menu.spec.md
  • packages/ui-headless/core/src/navigation-menu/vanilla.ts
  • packages/ui-headless/browser-contract/navigation-menu.contract.ts, the shared browser assertions.
  • Each framework package has a matching browser/navigation-menu.spec.ts contract entry.