Context Menu
The Context Menu component offers contextual options or actions that appear when a user right-clicks an element
Examples
API
Prop | Description | Default |
---|---|---|
children * | Child element to trigger the context menu.ReactNode | |
content * | Content to show in the context menu.any | |
disabled | Whether the context menu is disabled.boolean | |
autofocus | Whether the context menu should autofocus on open.boolean | true |
autoClose | Whether the context menu should close on click.boolean | true |
triggerClassName | Class name to apply to the trigger element.string | |
triggerOpenClassName | Class name to apply to the trigger when the context menu is open.string | |
theme | Theme for the Context Menu.ContextMenuTheme | |
reference | Reference of the overlay to align to.ReferenceProp | |
trigger | Type of trigger to open the overlay.TriggerTypes | TriggerTypes[] | |
triggerElement | Trigger element to open the overlay.any | |
portalClassName | Portal classname.string | |
closeOnBodyClick | Close when the body is clicked or not.boolean | true |
closeOnEscape | Close when escape is pressed or not.boolean | true |
appendToBody | Append the overlay to the body. Almost always want this.boolean | |
elementType | Overlay element type.string | |
modifiers | Position modifiers.Modifiers | |
followCursor | Overlay should follow cursor or not.boolean | |
placement | Placement of the overlay.Placement | |
onOpen | Event called when the overlay is opened.(event?: any) => void | |
onClose | Event called when the overlay is closed.(event?: any) => void |