ContextMenu
Right-click and controlled floating menu built on Floating UI.
ContextMenu
Right-click and controlled floating menu built on Floating UI. It supports uncontrolled context-menu triggers and controlled coordinates through v-model, x, and y.
Basic Usage
ContextMenu
Demo will load when visible.
API
TxContextMenu Props
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | boolean | undefined | undefined | Controlled open state; leave undefined for internal uncontrolled state. |
x | number | 0 | Controlled menu anchor X coordinate. |
y | number | 0 | Controlled menu anchor Y coordinate. |
width | number | 220 | Menu panel width in pixels. |
closeOnEsc | boolean | true | Closes the menu when Escape is pressed. |
closeOnClickOutside | boolean | true | Closes the menu on pointer events outside the trigger and menu. |
TxContextMenu Events
| Event | Params | Description |
|---|---|---|
open | { x: number; y: number } | Emitted when the menu opens with the active anchor coordinates. |
close | - | Emitted when the menu closes. |
TxContextMenuItem Props
| Prop | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Disables selection and item clickability. |
danger | boolean | false | Applies danger styling to the item label. |
TxContextMenuItem Events
| Event | Params | Description |
|---|---|---|
select | - | Emitted when an enabled item is selected; the parent context menu then closes. |