Examples › Basic configuration
The ContextMenuProvider
component accepts the following props that are used as default values for the context menu container:
zIndex: number
→ defaults to9999
shadow: MantineShadow
→ defaults tosm
(see Mantine Paper docs)borderRadius: MantineSize
→ defaults toxs
(see Mantine Paper docs)repositionOnRepeat: boolean
→ defaults tofalse
Whether to reposition the context menu when the triggering event repeats.
If set to true, the context menu will reposition itself to the position of the triggering event.
If unset or set to false, the context menu will hide automatically when the triggering event repeats.
The zIndex
value can be overridden by setting the zIndex
property to the options object passed as the second argument to the showContextMenu
function returned by the useContextMenu
hook:
Right-click on the image to trigger the context menu:

Picture by Michael Sum
Head over to the next example to discover other features.