Dropdown menu
A list of actions that opens from a button.
Add the source to a shadcn project
npx shadcn@latest add https://docs.atomus.io/r/dropdown-menu.jsonOpen in v0Installs the component source, its CSS and the Atomus tokens into components/atomus/. How the registry works
In Figma
Section titled “In Figma”From guidelines/components/menu.md · Open in Figma: DropdownMenu · MenuItem
Properties, variants and anatomy of the Figma components. React props use the same names.
Dropdown menu
Section titled “Dropdown menu”Floating menu; items live in a slot.
Variants: 1
| Property | Type / options |
|---|---|
| Items | slot (any content) |
Menu item
Section titled “Menu item”Row for dropdowns, selects, context and command menus.
Variants: 8
| Property | Type / options |
|---|---|
| Label | text |
| Leading icon | boolean (on) |
| Leading icon swap | instance swap (icon) |
| Shortcut | boolean (off) |
| Shortcut text | text |
| Size | sm · md |
| State | Default · Hover · Selected · Disabled |
Context menu
Section titled “Context menu”Right-click menu with shortcuts, separators, destructive item and submenus.
Variants: 2
| Property | Type / options |
|---|---|
| Type | Default · Submenu open |
import { DropdownMenu, MenuItem } from '@stanvision/atomus-react';
<DropdownMenu label="Project actions" trigger={<Button hierarchy="outline">Actions</Button>} items={[ { label: 'Rename', shortcut: '⌘R', onSelect: rename }, { type: 'separator' }, { label: 'Delete', destructive: true, onSelect: remove }, ]}/>A list of actions that opens from a button. MenuItem is exported for custom lists.
Props at a glance
Section titled “Props at a glance”Full types and defaults are in React API at the end of the page.
trigger— the button that opens it (it getsaria-haspopup,aria-expandedand arrow-key opening).items—{ label, icon?, shortcut?, disabled?, destructive?, onSelect },{ type: 'separator' }or{ type: 'heading', label }.alignstart·end;sizesm36 ·md40;labelnames the menu.
Do
- Put destructive actions last, after a separator.
Don’t
- Don’t use it to pick a value — that’s Select.
Design guidance
Section titled “Design guidance”From the Figma guidelines.
Dropdown menu
Section titled “Dropdown menu”Do
- Drop Menu items into the Items slot.
- Group related items with separators and headings.
- Show keyboard shortcuts for power users.
Forbidden
- Never exceed about ten items — use Command menu.
- Never put forms inside menus.
- Never run a destructive item without a confirmation.
Context menu
Section titled “Context menu”Do
- Mirror actions that also exist elsewhere in the UI; put destructive items last, in red.
Forbidden
- Never hide an action only in a context menu.
React API
Section titled “React API”Generated from react/src/components by scripts/gen-react-api.mjs — the same tables agents read in guidelines/components/menu.md.
Use only these props; anything else is not part of the API.
DropdownMenu
Section titled “DropdownMenu”Figma: Dropdown menu / Context menu — keyboard: ↑ ↓ Home End Enter Esc.
import { DropdownMenu } from '@stanvision/atomus-react'; — source: react/src/components/Menu.tsx
| Prop | Type | Default | Description |
|---|---|---|---|
trigger |
ReactElement |
required | The element that opens the menu, usually a Button |
items |
DropdownItem[] |
required | Figma: Items slot |
align |
'start' | 'end' |
'start' |
Alignment. |
size |
'sm' | 'md' |
'sm' |
Size. |
label |
string |
— | Accessible name for the menu |
defaultOpen |
boolean |
— | Start open (docs and tests) |
className |
string |
— | Extra class on the root element (layout only — never restyle colours or sizes). |
Accepts only the props above.
DropdownItem:
type DropdownItem = | { type?: 'item'; label: ReactNode; icon?: ReactNode; shortcut?: string; disabled?: boolean; destructive?: boolean; onSelect?: () => void } | { type: 'separator' } | { type: 'heading'; label: ReactNode };MenuItem
Section titled “MenuItem”Figma: Menu item — row for dropdowns, selects, context and command menus.
import { MenuItem } from '@stanvision/atomus-react'; — source: react/src/components/Menu.tsx
| Prop | Type | Default | Description |
|---|---|---|---|
label |
ReactNode |
required | Figma: Label |
icon |
ReactNode |
— | Figma: Leading icon + Leading icon swap |
shortcut |
string |
— | Figma: Shortcut + Shortcut text |
size |
'sm' | 'md' |
'sm' |
Figma: Size — sm 32 · md 40 |
selected |
boolean |
— | Figma: State=Selected — shows a check |
disabled |
boolean |
— | Disables the control. |
destructive |
boolean |
— | Red label for destructive actions (Context menu) |
onSelect |
() => void |
— | Called when the item is chosen. |
role |
'menuitem' | 'option' | 'menuitemcheckbox' |
'menuitem' |
ARIA role. |
id |
string |
— | Element id; generated when omitted (wires label and hint). |
active |
boolean |
— | Highlighted by keyboard navigation. |
Accepts only the props above.