Overlays
Menu
A list of actions. Opened by MenuButton, SplitButton or a row action.
- Group with
sectiontitles anddividers; destructive items last withtone: 'critical'. - Show shortcuts with Kbd. Keep labels to verbs: “Assign to me”.
- Width 200–320px; long labels wrap, unbroken IDs break. If any item has
checked, every item gets a check column so labels line up; items without an icon keep the icon space when others have one. - Keyboard: ↑ ↓ move (disabled items skipped), Home/End jump, typing a letter jumps to the next item starting with it, Esc closes and returns focus to the button.
descriptionadds a muted second line;submenuadds a chevron.
When to use
A list of actions on an object, opened from MenuButton, SplitButton or a row's ⋯.
Use something else
Choosing a form value → Select. Navigation → SideNav, TopNav or Tabs.
Do
- Start items with verbs; keep them short.
- Group with
sectionanddivider; put destructive items last withtone: 'critical'. - Show shortcuts with
shortcutwhen they exist.
Don't
- Don't nest submenus more than one level.
- Don't put more than ~10 items; split into sections or a dialog.
Props
| Prop | Type |
|---|---|
items required | MenuItem[] |
onSelect | (id: string) => void; onClose?: (reason: string) => void; autoFocus?: boolean; label?: string; id?: string; width?: number; className?: string |
Use
const { Menu } = window.Tessera;
const el = React.createElement(Menu, { /* props */ });