
Product
Socket Now Protects the Chrome Extension Ecosystem
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
mantine-contextmenu
Advanced tools
Craft your applications for productivity and meet your users’ expectations by enhancing your Mantine-based UIs with a desktop-grade, lightweight yet fully-featured, dark-theme aware context-menu component, built by the creator of Mantine DataTable
Craft your applications for productivity and meet your users’ expectations by enhancing your Mantine-based UIs with a desktop-grade, lightweight yet fully-featured, dark-theme aware context-menu component, built by the creator of Mantine DataTable.
⚠️ NOTE: Mantine ContextMenu V8.x is compatible with Mantine V8.x (and probably V7).
💡 If you're looking for the old version that works with Mantine V6, head over to Mantine ContextMenu V6.
ContextMenuProvider
component and use the hook-generated function in your codeclassName
/classNames
and style
/styles
props to customize the context menu appearanceVisit icflorescu.github.io/mantine-contextmenu to view the full documentation and learn how to use it by browsing the list of usage examples.
Create a new Mantine application, make sure to have the clsx
peer dependency installed,
then install the package with npm i mantine-contextmenu
or yarn add mantine-contextmenu
.
Import the necessary CSS files:
import '@mantine/core/styles.layer.css';
import 'mantine-contextmenu/styles.layer.css';
import './layout.css';
Make sure to apply the styles in the correct order:
/* layout.css */
/* 👇 Apply Mantine core styles first, ContextMenu styles second */
@layer mantine, mantine-contextmenu;
Wrap your application in a ContextMenuProvider
inside the MantineProvider
:
import { MantineProvider } from '@mantine/core';
import { ContextMenuProvider } from 'mantine-contextmenu';
function App() {
return (
<MantineProvider>
<ContextMenuProvider>{/* your app code here... */}</ContextMenuProvider>
</MantineProvider>
);
}
Use the showContextMenu
function generated by the useContextMenu
in your code:
'use client';
// 👆 Since 'useContextMenu' is a hook, don't forget to add the 'use client' directive
// at the top of your file if you're using it in a RSC context
import { IconCopy, IconDownload } from '@tabler/icons-react';
import { useContextMenu } from 'mantine-contextmenu';
import Picture from '~/components/Picture';
import { copyImageToClipboard, downloadImage, unsplashImages } from '~/lib/image';
export default function GettingStartedExample() {
const { showContextMenu } = useContextMenu();
const image = unsplashImages[0];
const { src } = image.file;
return (
<Picture
image={image}
onContextMenu={showContextMenu([
{
key: 'copy',
icon: <IconCopy size={16} />,
title: 'Copy to clipboard',
onClick: () => copyImageToClipboard(src),
},
{
key: 'download',
icon: <IconDownload size={16} />,
title: 'Download to your computer',
onClick: () => downloadImage(src),
},
])}
/>
);
}
Make sure to browse the list of usage examples to learn how to unleash the full power of Mantine ContextMenu.
💡 Mantine DataTable - The lightweight, dependency-free, dark-theme aware table component for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, intuitive Gmail-style additive batch rows selection, column sorting, custom cell data rendering, row expansion, nesting, context menus, and much more. Built by the creator of Mantine ContextMenu.
See the contributing guide in the documentation website or the repo CONTRIBUTING.md file for details.
💡 Most importantly, please make sure to target your PRs to the next
branch!
Here's the list of people who have already contributed to Mantine ContextMenu:
Want to become a code contributor?
If you find this package useful, please consider ❤️ sponsoring my work.
Your sponsorship will help me dedicate more time to maintaining the project and will encourage me to add new features and fix existing bugs.
If you're a company using Mantine, Mantine ContextMenu or Mantine DataTable in a commercial project, you can also hire my services.
If you can't afford to sponsor the project or hire my services, there are other ways you can support my work:
The more stars this repository gets, the more visibility it gains among the Mantine users community. The more users it gets, the more chances that some of those users will become active code contributors willing to put their effort into bringing new features to life and/or fixing bugs.
As the repository gain awareness, my chances of getting hired to work on Mantine-based projects will increase, which in turn will help maintain my vested interest in keeping the project alive.
If you want to hire my services, don't hesitate to drop me a line at the email address listed in my GitHub profile.
I'm currently getting a constant flow of approaches, some of them relevant, others not so relevant.
Mentioning “Mantine ContextMenu” in your text would help me prioritize your message.
The MIT License.
8.1.3 (2025-07-21)
FAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.