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 barWhen 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
| Prop | Type | Required | Description |
|---|---|---|---|
label | string | — | Fallback trigger label if trigger is not supplied. |
trigger | React.ReactNode | — | Custom trigger element (e.g. an IconButton). It gets aria-haspopup, aria-expanded and aria-controls, and opens the menu on click. |
items | MenuItemSpec[] | Yes | |
align | "start" | "end" | — | |
header | React.ReactNode | — | Rendered at the top of the menu (e.g. the signed-in user). Not a menu item; the arrow keys skip it. |
linkComponent | LinkComponent | — | Overrides LinkProvider's link component for this menu's link items. |