Use ContextMenu to show actions on right-click.
pnpm dlx shadcn@latest add @tile-ui/context-menu
import { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem } from '@tile-ui/vue';
<ContextMenu>
<ContextMenuTrigger>Right-click me</ContextMenuTrigger>
<ContextMenuContent>
<ContextMenuItem>Copy</ContextMenuItem>
<ContextMenuItem>Paste</ContextMenuItem>
</ContextMenuContent>
</ContextMenu>
- Trigger and content
- Item, checkbox, and radio
- Sub menus
| Item |
Purpose |
context-menu |
Component source and module styles |
core |
Framework-agnostic logic helpers |
styles |
Shared SCSS tokens and globals |
| Prop |
Type |
Default |
open |
boolean |
— |
defaultOpen |
boolean |
— |
onOpenChange |
(open: boolean) => void |
— |
| Prop |
Type |
Default |
asChild |
boolean |
— |
| Prop |
Type |
Default |
inset |
boolean |
— |
variant |
'default' | 'destructive' |
— |
disabled |
boolean |
— |
onSelect |
(event: Event) => void |
— |
| Prop |
Type |
Default |
checked |
boolean |
— |
defaultChecked |
boolean |
— |
onCheckedChange |
(checked: boolean) => void |
— |
disabled |
boolean |
— |
| Prop |
Type |
Default |
value |
string |
— |
defaultValue |
string |
— |
onValueChange |
(value: string) => void |
— |
| Prop |
Type |
Default |
value |
string |
— |
disabled |
boolean |
— |
| Prop |
Type |
Default |
inset |
boolean |
— |
| Prop |
Type |
Default |
open |
boolean |
— |
defaultOpen |
boolean |
— |
onOpenChange |
(open: boolean) => void |
— |
| Prop |
Type |
Default |
inset |
boolean |
— |
disabled |
boolean |
— |