Skip to main content

Menu

A button-triggered menu with keyboard nav and click-outside close; items can be actions or links.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

  • Use it when A list of actions triggered from a button.
  • Reach for something else when Choosing a form value — use Select.

Accessibility​

Focus is trapped while open and restored to the trigger on close. Esc dismisses. The surface is labelled by its title (aria-labelledby) and marked role="dialog" / aria-modal.

Install and import​

npx shadcn@latest add @prism/menu
import { Menu } from '@/components/prism/Menu';

In a no-build prototype, read it from the bundle instead: const { Menu } = window.PrismDesignSystem_39d121;

Props​

PropTypeRequiredDescription
labelstring—Fallback trigger label if trigger is not supplied.
triggerReact.ReactNode—Custom trigger element (e.g. an IconButton). It gets aria-haspopup, aria-expanded and aria-controls, and opens the menu on click.
itemsMenuItemSpec[]Yes
align"start" | "end"—
headerReact.ReactNode—Rendered at the top of the menu (e.g. the signed-in user). Not a menu item; the arrow keys skip it.
linkComponentLinkComponent—Overrides LinkProvider's link component for this menu's link items.