Switch theme

Examples › Action colors

You can provide action colors 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),
},
{
key: 'delete',
color: 'red',
icon: <IconTrash size={16} />,
onClick: handleDelete,
},
])}
/>
);
Right-click on the image to trigger the context menu:
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