Ballmac UI home

Mac Context Menu

A right-click menu styled like macOS: frosted panel, accent-color highlight, key equivalents, checkmarks, submenus and a red destructive item, on Radix for full keyboard support.

Q3 Report.pdfRight-click, or long-press on touch

Installation

$ pnpm dlx shadcn@latest add @ballmac/mac-context-menu

Usage

import { MacContextMenu, MacContextMenuTrigger, MacContextMenuContent, MacContextMenuItem, MacContextMenuCheckboxItem, MacContextMenuRadioGroup, MacContextMenuRadioItem, MacContextMenuLabel, MacContextMenuSeparator, MacContextMenuShortcut, MacContextMenuSub, MacContextMenuSubTrigger, MacContextMenuSubContent } from "@/components/ballmac/mac-context-menu"

The full example is in the Code tab above.

Examples

Checkmarks and radio items

Sorted by name, preview on. Right-click to change.

API reference

PropTypeDefault
icon

Leading icon, drawn in the left gutter.

React.ReactNode—
shortcut

Key equivalent shown at the right, such as ⌘C.

string—
destructive

Destructive items turn red until highlighted.

boolean—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Shift+F10 / ContextMenu keyOpens the menu on the focused trigger
ArrowUp / ArrowDownMoves through items; ArrowRight opens a submenu
EscapeCloses

Use with AI

Compose <MacContextMenu><MacContextMenuTrigger/><MacContextMenuContent> with MacContextMenuItem (icon, shortcut, destructive), CheckboxItem, RadioGroup/RadioItem, Label, Separator and Sub parts. Shift+F10 and long-press also open it. With the shadcn MCP server set up (guide), ask your agent:

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

Use it for

  • Desktop-like apps and file managers
  • Anywhere you want the macOS look

Not for

  • Standard product UI (context-menu)
  • Click-opened menus (dropdown-menu)

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

Credits

Free to use in personal and commercial projects.

Registry
shadcn/utils