Dropdown Menu
A list of actions opened from a button. Built on ui-sdk's Menu: arrow keys move, typing jumps to a row, Escape closes and focus returns to the trigger. Rows show keyboard focus with the hover highlight, never a ring, and ticks sit on the right.
BetaReady to use. Its API can still change in a minor release; the changelog says when.
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from "@leap-crm/design-system";Playground
Change a prop and the component follows. Its code is under Props.
Props
Best practices
When to use it, and the rules that apply in particular places.
| Guidance | Practice |
|---|---|
| Do | Use it for the actions on one record, opened from a button, like Edit, Duplicate and Delete behind an opportunity's ⋯ button. |
| Do | Open it from an IconButton passed to DropdownMenuTrigger's render, with an aria-label that names the record, like Opportunity actions. In a table, each row's trigger needs its own name. |
| Do | Put Delete, Remove or Archive last, below a DropdownMenuSeparator, and set destructive on it. The label says what it does, so the red tone is never the only signal. |
| Do | Use DropdownMenuCheckboxItem and DropdownMenuRadioItem for rows that toggle or choose. Their tick sits on the right, so every label starts at the same edge. |
| Don't | Give a row a focus ring, a coloured fill or a radius as large as the menu's. Rows show focus with the hover highlight, a chosen row shows a tick, and a row's corners stay smaller than the menu's. |
| Don't | Use it to choose a value for a form field, like a matter type, or add a search field to it. Use Select, or a Popover with PopoutSearch for a list that needs searching. |
Props
DropdownMenu also takes ui-sdk's Menu options (open, defaultOpen, onOpenChange, onAction, controller). Items take value, label, closeOnSelect and onSelect; returning a Promise from onSelect keeps the row busy and the menu open until it settles.
DropdownMenu
No props of its own.
DropdownMenuContent
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | What it shows inside. |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
| sideOffset | unknown | 4 | The gap between it and what it opens from, in pixels. |
DropdownMenuItem
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | An icon first, then the label: `<Trash2 /> Delete`. |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
DropdownMenuCheckboxItem
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | What it shows inside. |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
DropdownMenuRadioItem
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | What it shows inside. |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
DropdownMenuLabel
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
DropdownMenuSeparator
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
DropdownMenuSubTrigger
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | What it shows inside. |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
Code
What the playground shows, ready to copy.
import {
Button,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@leap-crm/design-system";
<DropdownMenu>
<DropdownMenuTrigger render={<Button intent="outline">Open menu</Button>} />
<DropdownMenuContent>
<DropdownMenuItem>Edit details</DropdownMenuItem>
<DropdownMenuItem>Duplicate</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>Actions
Icon and label rows, shortcuts as keys on the right, a submenu with a grey chevron, a disabled row in muted text, and Delete in the danger tone below a divider.
Checkbox and radio rows
Rows that toggle or choose show a navy tick on the right, with no fill; the highlight stays grey for hover and keyboard. Labels name each group.
What the examples share
The imports and the scaffolding the examples above call. The scaffolding lives in this page, not in the library.
import { Archive, Copy, MoreHorizontal, Pencil, Share2, Trash2 } from "lucide-react";
import { Button, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, IconButton } from "@leap-crm/design-system";
function RowActions() {
return (
<DropdownMenu>
<DropdownMenuTrigger
render={
<IconButton
intent="outline"
icon={<MoreHorizontal />}
aria-label="Opportunity actions"
/>
}
/>
<DropdownMenuContent className="w-56">
<DropdownMenuItem shortcut="mod+e">
<Pencil /> Edit details
</DropdownMenuItem>
<DropdownMenuItem shortcut="mod+d">
<Copy /> Duplicate
</DropdownMenuItem>
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<Share2 /> Share
</DropdownMenuSubTrigger>
<DropdownMenuSubContent className="w-44">
<DropdownMenuItem>Copy link</DropdownMenuItem>
<DropdownMenuItem>Email a colleague</DropdownMenuItem>
</DropdownMenuSubContent>
</DropdownMenuSub>
<DropdownMenuItem disabled>
<Archive /> Archive
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem destructive>
<Trash2 /> Delete
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
);
}Keyboard
The keys it answers to. Tab moves between components, arrows move within them.
| Keys | What they do |
|---|---|
| EnterSpaceArrowDown | Open the menu and focus the first item. |
| ArrowUp | Opens the menu and focuses the last item. |
| ArrowDownArrowUp | Move between items, skipping separators and labels. |
| HomeEnd | Move to the first and last items. |
| Typing | Moves to the next item that starts with what was typed. |
| Enter | Runs the focused item, closes the menu and returns focus. |
| ArrowRightArrowLeft | Open a submenu, and close it back to its trigger. |
| Escape | Closes the menu and returns focus to the trigger. |
| Tab | Closes the menu. |







