Ballmac UI home

Dropdown Menu

An action menu on a trigger with checkbox and radio items, submenus, shortcut hints and destructive rows, built on Radix for full keyboard and typeahead support.

JR

Jordan Rivera

jordan@acme.example

Installation

$ pnpm dlx shadcn@latest add @ballmac/dropdown-menu

Usage

import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent } from "@/components/ballmac/dropdown-menu"

The full example is in the Code tab above.

Examples

By last modified, grid

API reference

<DropdownMenuItem>

PropTypeDefault
inset

Indent the item so it lines up with items that show a check or icon.

boolean—
destructive

Style the item as a destructive action (delete, sign out).

boolean—

<DropdownMenuLabel>

PropTypeDefault
inset

Indent the label to match inset items.

boolean—

<DropdownMenuSubTrigger>

PropTypeDefault
inset

Indent the trigger to match inset items.

boolean—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Enter / Space / ArrowDownOpens the menu from the trigger
ArrowUp / ArrowDownMoves between items; Home and End jump
Type a letterJumps to the next item starting with it
ArrowRight / ArrowLeftOpens and closes a submenu
EscapeCloses and returns focus to the trigger

Use with AI

Opens a menu of actions from a button. Supports groups, labels, checkbox and radio items, nested submenus, shortcuts and a destructive style. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Dropdown Menu (@ballmac/dropdown-menu) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Account, row and overflow (…) actions
  • Sort and view preferences with radio items
  • Menus with a submenu or checked options

Not for

  • Choosing a form value; use select or combobox
  • Right-click menus; use context-menu
  • A persistent app menu bar; use menubar

Registry JSON: https://ui.ballmac.com/r/dropdown-menu.json

Credits

Based on shadcn/ui Dropdown Menu, adapted by Ballmac. Free to use in personal and commercial projects.