Context Menu
Right-click a target to open actions for that item. Try a submenu, a checkbox item and a group of radio items.
On this page
Usage
Right click here
Installation
Set up your license key before connecting the private registry.
Connect this project to https://docs.interfacesds.com using the full URL shown below, including {name}. In components.json, add the registries field at the top level. If the field already exists, add only the @interfaces-ds entry inside it. Keep your existing aliases and other registries.
For a global stylesheet in app/ or src/app/.
JSON{ "registries": { "@interfaces-ds": { "url": "https://docs.interfacesds.com/r/{name}.json", "headers": { "Authorization": "Bearer ${INTERFACES_DS_LICENSE_KEY}" } } } }Install the component.
Terminalnpx shadcn@latest add @interfaces-ds/context-menu
API reference
Import these exports from @/components/ui/context-menu. The tables cover component-specific props and common controls.
ContextMenu
| Prop | Type | Default |
|---|---|---|
defaultOpen | boolean | — |
disabled | boolean | — |
modal | boolean | — |
onOpenChange | (open: boolean, eventDetails: ContextMenuPrimitive.Root.ChangeEventDetails) => void | — |
open | boolean | — |
orientation | "horizontal" | "vertical" | — |
ContextMenuTrigger
| Prop | Type | Default |
|---|---|---|
asChild | boolean | — |
ContextMenuContent
| Prop | Type | Default |
|---|---|---|
forceMount | true | — |
ContextMenuItem
| Prop | Type | Default |
|---|---|---|
asChild | boolean | — |
disabled | boolean | — |
inset | boolean | — |
label | string | — |
variant | "default" | "danger" | "default" |
ContextMenuCheckboxItem
| Prop | Type | Default |
|---|---|---|
asChild | boolean | — |
checked | boolean | — |
defaultChecked | boolean | — |
disabled | boolean | — |
label | string | — |
onCheckedChange | (checked: boolean, eventDetails: ContextMenuPrimitive.CheckboxItem.ChangeEventDetails) => void | — |
ContextMenuRadioItem
| Prop | Type | Default |
|---|---|---|
asChild | boolean | — |
disabled | boolean | — |
label | string | — |
ContextMenuLabel
| Prop | Type | Default |
|---|---|---|
inset | boolean | — |
ContextMenuSeparator
| Prop | Type | Default |
|---|---|---|
orientation | "horizontal" | "vertical" | — |
ContextMenuShortcut
ContextMenuGroup
ContextMenuPortal
| Prop | Type | Default |
|---|---|---|
forceMount | true | — |
keepMounted | boolean | — |
ContextMenuSub
| Prop | Type | Default |
|---|---|---|
defaultOpen | boolean | — |
disabled | boolean | — |
onOpenChange | (open: boolean, eventDetails: ContextMenuPrimitive.SubmenuRoot.ChangeEventDetails) => void | — |
open | boolean | — |
orientation | "horizontal" | "vertical" | — |
ContextMenuSubContent
| Prop | Type | Default |
|---|---|---|
forceMount | true | — |
ContextMenuSubTrigger
| Prop | Type | Default |
|---|---|---|
asChild | boolean | — |
disabled | boolean | — |
inset | boolean | — |
label | string | — |
ContextMenuRadioGroup
| Prop | Type | Default |
|---|---|---|
disabled | boolean | — |
onValueChange | (value: any, eventDetails: ContextMenuPrimitive.RadioGroup.ChangeEventDetails) => void | — |