Animated Context Menu

A right-click menu assembled from parts (items, checkbox and radio items, labels, separators, shortcuts) that opens from the exact spot you clicked, or long-pressed on touch, with a highlight that slides between rows, arrow-key movement and type-to-jump search.

Preview

Animated Context Menu preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/context-menu
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

ContextMenu

open?
boolean
—
defaultOpen?
boolean
false
onOpenChange?
((open: boolean) => void)
—
className?
string
—

ContextMenuTrigger

disabled?
boolean
false
className?
string
—

ContextMenuContent

className?
string
—
ariaLabel?
string
Context menu

ContextMenuItem

onSelect?
(() => void)
—
disabled?
boolean
—
closeOnSelect?
boolean
—
tone?
"default" | "destructive"
—
inset?
boolean
—
className?
string
—
textValue?
string
—

ContextMenuCheckboxItem

checked
boolean
—
onCheckedChange?
((checked: boolean) => void)
—
disabled?
boolean
—
className?
string
—
inset?
boolean
—
closeOnSelect?
boolean
—
tone?
"default" | "destructive"
—
textValue?
string
—

ContextMenuRadioGroup

value
string
—
onValueChange?
((value: string) => void)
—
className?
string
—

ContextMenuRadioItem

value
string
—
disabled?
boolean
—
className?
string
—
inset?
boolean
—
closeOnSelect?
boolean
—
tone?
"default" | "destructive"
—
textValue?
string
—

ContextMenuLabel

inset?
boolean
false
className?
string
—

ContextMenuSeparator

className?
string
—

ContextMenuShortcut

className?
string
—

Updated