Getting StartedInstall and bootstrap headless foundations 4
LayoutHeadless structural primitives for expandable and container patterns 6
OverlayHeadless modal and floating layer behavior 3
FeedbackHeadless notification and status communication patterns 5
FormHeadless input and selection contracts 17
UtilityReusable action, identity, and clipboard behavior 6
NavigationHeadless trails, trees, menus, and command surfaces 7

Menu overview

Headless menu owns the panel, selection, submenus, and keyboard behavior. Pair tngMenuTrigger with tngMenu for standalone dropdowns, or compose with tngMenubar for command strips (see the Menubar docs).

Primitive imports

ts
import {
  TngMenu,
  TngMenuTrigger,
  TngMenuItem,
  TngMenuGroupLabel,
  TngMenuSeparator,
} from '@tailng-ui/primitives';

Basic composition

Place a trigger before the panel. Link them with [tngMenuTrigger] so open/close, aria-expanded, and focus restoration stay coordinated.

Headless menu composition

html
<div class="menu-shell">
  <button type="button" [tngMenuTrigger]="overviewUsageActionsMenu">Open</button>
  <div tngMenu #overviewUsageActionsMenu="tngMenu" aria-label="Actions">
    <button type="button" tngMenuItem tngMenuItemValue="save">Save</button>
  </div>
</div>

Style variants

The same primitive markup rendered through a plain CSS contract or Tailwind utility shell.

Headless menu (plain CSS)

Actions menu

A single trigger opens a panel; you control placement and elevation with CSS.

Last command: No command yet

Keyboard baseline

  • Trigger:Enter/Space open; ArrowDown opens focusing first item; ArrowUp opens focusing last item; Escape closes when open.
  • Open panel:ArrowDown/ArrowUp move active item; Home/End jump; typeahead matches item text; Enter/ Space activates; Escape closes (submenu closes to parent first).
  • Submenus:ArrowRight opens; ArrowLeft closes nested panel and returns focus to the parent menu.