Switch theme

Examples › Action icons

You can provide action icons to the context menu items, like so:
const showContextMenu = useContextMenu();
// ...
return (
<Picture
image={image}
onContextMenu={showContextMenu([
{
key: 'copy',
icon: <IconCopy size={16} />,
onClick: () => copyImageToClipboard(src),
},
{
key: 'download',
icon: <IconDownload size={16} />,
onClick: () => downloadImage(src),
},
])}
/>
);
Right-click on the image to trigger the context menu:
Picture by Roberto Huczek | Mantine ContextMenu
Picture by Roberto Huczek
MIT LicenseSponsor the author
Built by Ionut-Cristian Florescu, the author of Mantine DataTable.
Please sponsor my work if you find it useful.
GitHub StarsNPM Downloads