Menu

Headless menu primitives for contextual actions and grouped menu items.

Stable direction
@lattice-ui/menu

Part of the stable direction toward v1.0.

What It Is For

Use Menu for contextual action lists where opening the surface should immediately hand focus to the first available item.

It is appropriate for action menus and command surfaces, not value-selection widgets like Select.

Preview size

Live demo is experimental and may contain bugs.

Install

Global CLI command: lattice add menu

Monorepo local script

Use your package manager wrapper when running the local lattice command.

pnpm lattice add menu

npm package: @lattice-ui/menu

Peer dependencies

  • @rbxts/react
  • @rbxts/react-roblox

Providers

  • @lattice-ui/layer:PortalProvider? (optional)

Registry notes

  • Menu.Content can use PortalProvider for display order control.

Public Exports

  • Menu
  • Menu.Root
  • Menu.Trigger
  • Menu.Portal
  • Menu.Content
  • Menu.Item
  • Menu.Group
  • Menu.Label
  • Menu.Separator
  • MenuContent
  • MenuGroup
  • MenuItem
  • MenuLabel
  • MenuPortal
  • MenuRoot
  • MenuSeparator
  • MenuTrigger

State Model

  • Menu.Root supports controlled and uncontrolled open state and a modal mode flag.
  • Registered menu items are ordered and selection moves through that ordered set when the menu is open.
  • When the menu opens, the first enabled item receives focus; when it closes, focus can return to the trigger.

Key API

Menu.Root

Use open, defaultOpen, onOpenChange, and modal to define menu ownership and dismissal behavior.

Menu.Content

Use placement, offset, and outside-interaction hooks to position the surface and customize dismissal.

Menu.Item

Use disabled and onSelect for per-action behavior; calling preventDefault keeps the menu open when needed.

Composition Patterns

Overflow or kebab menus

Pair a compact trigger with grouped Menu.Item actions and separators for secondary actions that should not live in the main layout.

Contextual action blocks

Use labels and groups to separate destructive or advanced actions without giving up caller-owned visuals.

Cautions / Limits

  • This package models a flat action menu; there are no submenu primitives in the current public surface.
  • Menus open into item-focus mode immediately, so they are not a replacement for searchable or value-driven pickers.