Shadcn Dropdown Menu
React dropdown menu for actions, account menus, and settings. Built with TypeScript and Tailwind CSS for Next.js using Base UI — groups, shortcuts, and nested submenus.
A dropdown menu is a list of actions that opens from a button. Click a row and the menu closes. Use it for account menus, overflow toolbars, and settings — not for picking a form value.
Looking for a neobrutalism version for shadcn?
Same dropdown menu, thicker borders. The NeoBrutalism dropdown menu is the kit if you want that look.
Usage
import { Button } from "@/components/ui/button"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"<DropdownMenu>
<DropdownMenuTrigger render={<Button variant="outline" />}>
Open
</DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuGroup>
<DropdownMenuLabel>My Account</DropdownMenuLabel>
<DropdownMenuItem>Profile</DropdownMenuItem>
<DropdownMenuItem>Billing</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuGroup>
<DropdownMenuItem>Team</DropdownMenuItem>
<DropdownMenuItem>Subscription</DropdownMenuItem>
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>Put render={<Button />} on the trigger so the Button is the actual control. sideOffset on content defaults to 4.
Composition
Basic
Labels, separators, and a disabled item.
Submenu
DropdownMenuSub nests a second panel. Keep it one extra level.
Shortcuts
DropdownMenuShortcut paints ⌘S. It does not bind the key.
Icons
An icon before the label. variant="destructive" is the red row.
Checkboxes
DropdownMenuCheckboxItem for options that toggle independently.
Checkboxes Icons
Same toggles, with an icon in the row.
Radio Group
DropdownMenuRadioGroup plus DropdownMenuRadioItem when only one value can be on.
Radio Icons
Exclusive choices with an icon in each row.
Destructive
variant="destructive" on the row that cannot be undone. Separate it from the rest.
Avatar
An Avatar as the trigger. Account, billing, sign out.
Complex
Groups, icons, checkboxes, radios, and nested submenus in one menu.
RTL
Wrap with DirectionProvider and dir="rtl". Submenus open toward the start.
API
Prop
Type
DropdownMenuContent
Prop
Type
DropdownMenuItem
Prop
Type
DropdownMenuCheckboxItem takes checked and onCheckedChange. DropdownMenuRadioGroup takes value and onValueChange. DropdownMenuLabel and DropdownMenuSubTrigger take inset.
Keyboard
| Key | Action |
|---|---|
Space / Enter | Open from the trigger, or activate the focused item |
ArrowDown | Open from the trigger, or move to the next item |
ArrowUp | Move to the previous item |
ArrowRight / ArrowLeft | Open or close a submenu |
Escape | Close and return focus to the trigger |
Type a letter to jump to the next item that starts with it.
Notes
Shortcuts are labels
DropdownMenuShortcut does not bind a key. Show ⇧⌘P in the row, then listen for the combination yourself.
onSelect dismisses the menu. Call event.preventDefault() if a checkbox should stay open.
With other components
Trigger for the menu
AvatarAccount switcher trigger
KbdShortcut next to the label
DialogConfirm a destructive pick
SeparatorSplit groups in the list
Alert DialogGate a delete item
Questions
Related
Was this page helpful?
Sign in to leave feedback.
Drawer
React drawer for mobile sheets and side panels. Built with TypeScript and Tailwind CSS for Next.js using Base UI — swipe to dismiss, four sides, snap points.
Empty
React empty state for no-data lists and first-run screens. Built with TypeScript and Tailwind CSS for Next.js using Base UI — icon, title, description, and action.