AI · MCP Server and Agent Skills included

Right-click React Context Menu, now easier to build with AI

Open a menu where users right-click or touch and hold, with nested submenus, icons, separators, item templates, and items that change with the target. AI assistants set it up for you from the current docs.

  • 4.5/5 850+ G2 reviews
  • 4.6/5 950+ Capterra reviews
  • WCAG 2.2 and Section 508
  • Nested submenus
  • Touch hold to open

Trusted by the world’s leading companies

Syncfusion customers include Visa, Apple, McDonald’s, Netflix, Starbucks, IBM, Tesla, and Schneider Electric

Now easier with AI

Build context menus faster with AI

Coding assistants write the Context Menu setup from the current docs instead of guessing.

01For developers

Describe the menu and get code that uses the documented API

The Syncfusion MCP server and Agent Skills give assistants in VS Code, Cursor, and JetBrains the current Context Menu docs and recommended patterns.

See all 34 features

AI coding assistantMCP Server · Syncfusion React

Show Cut, Copy, Paste, Link, and New Comment when users right-click the box.

search_docs“React Context Menu menu on any target” · 2 doc sections

Excerpt: imports and sample data omitted.

+const items = [{ text: 'Cut' }, { text: 'Copy' },

+ { text: 'Paste', items: [{ text: 'Paste Special' }] },

+ { separator: true }, { text: 'Link', disabled: true },

+ { text: 'New Comment' }];

+<ContextMenuComponent target="#files" items={items} />

Documented API: target, items, separator, disabled

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Add a Share submenu with Email and Copy link, each with an icon.

search_docs“React Context Menu submenus and icons” · 2 doc sections

Excerpt: imports and sample data omitted.

{ text: 'Share', iconCss: 'e-icons e-share',

+ items: [{ text: 'Email', iconCss: 'e-icons e-mail' },

+ { text: 'Copy link', iconCss: 'e-icons e-link' }] }

Documented API: items, iconCss

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Show each menu item with a short description under its name.

search_docs“React Context Menu item templates” · 2 doc sections

Excerpt: imports and sample data omitted.

+const items = [{ text: 'Selection', description: 'Choose from options' },

+ { text: 'Yes / No', description: 'Select Yes or No' },

+ { text: 'Text', description: 'Type own answer' },

+ { text: 'None', description: 'No answer required' }];

+<ContextMenuComponent target="#editor" items={items}

+itemTemplate={(item) => <span>{item.text}<small>{item.description}</small></span>} />

Documented API: itemTemplate

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Hide Add and Edit when users right-click the notes area.

search_docs“React Context Menu items that match the target” · 2 doc sections

Excerpt: imports and sample data omitted.

+<ContextMenuComponent ref={menu} target="#target"

+ items={items}

+ beforeOpen={(e) => e.event.target.id === 'notes'

+? menu.current.hideItems(['Add', 'Edit']) :

+ menu.current.showItems(['Add', 'Edit'])} />

Documented API: beforeOpen, hideItems, showItems

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Disable Paste until something is copied, and add a Refresh item after View.

search_docs“React Context Menu enable, add, and remove items” · 2 doc sections

Excerpt: imports and sample data omitted.

menu.current.enableItems(['Paste'], false);

+menu.current.insertAfter([{ text: 'Refresh' }], 'View');

+menu.current.removeItems(['Delete']);

Documented API: enableItems, insertAfter, removeItems

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Make the menu scroll when it has more items than fit in 150 pixels.

search_docs“React Context Menu scrolling for long menus” · 2 doc sections

Excerpt: imports and sample data omitted.

+<ContextMenuComponent target="#files" items={items}

+ enableScrolling={true}

+beforeOpen={(e) => { e.element.parentElement.style.height = '150px'; }} />

Documented API: enableScrolling, beforeOpen

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Open the context menu under the More button when users click it.

search_docs“React Context Menu open and close from code” · 2 doc sections

Excerpt: imports and sample data omitted.

+<button

+ onClick={(e) => menu.current.open(e.clientY + 8, e.clientX)}>More</button>

+const items = [{ text: 'Duplicate' }, { text: 'Rename' },

+ { text: 'Download' }];

+<ContextMenuComponent ref={menu} items={items} />

+menu.current.close();

Documented API: open, close

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Underline the access key letters in Cut, Copy, and Paste.

search_docs“React Context Menu underlined access keys” · 2 doc sections

Excerpt: imports and sample data omitted.

+<ContextMenuComponent target="#target" items={items}

+ beforeItemRender={(args) => {

+if (args.item.text === 'Copy')

+ args.element.innerHTML = '<u>C</u>opy';

+ }} />

Documented API: beforeItemRender

ResultRendered in your app

Accessibility

Accessible to keyboard and screen reader users

The React Context Menu component follows WAI-ARIA practices, with keyboard access and screen reader support.

Standards
WCAG 2.2 and Section 508
Keyboard
Enter, Esc
Screen readers
aria-haspopup and aria-expanded
Layout
Right-to-left and mobile support
Read the accessibility docs

Features in depth

React Context Menu features in depth

Open a demo to try each one, or the docs to see the API.

Open on any target: right-click or touch and hold

Set a target selector, and filter to limit it to matching child elements. The open and close methods show the menu at any position from your own triggers.

Multilevel nesting with flip-and-fit

Nest items at any depth, opened on hover or, with showItemOnClick, on click. Collision detection flips and fits submenus, and phones show nested levels in a single layer.

Icons, separators, and URL navigation

Add a font icon or image to items with iconCss, group items with separator lines, and set a url so an item opens a page.

Item templates and custom items

The itemTemplate property renders each item with any JSX. The beforeItemRender event adds shortcuts, underlined access keys, checkboxes, or a table inside items.

Dynamic items: show, hide, enable, add, and remove

Change the menu for each target in the beforeOpen event with hideItems and showItems. The enableItems, insertAfter, insertBefore, and removeItems methods update items at run time.

Animation and scrollable menus

The animationSettings property sets a SlideDown, ZoomIn, FadeIn, or no effect with its duration and easing. With enableScrolling, long menus scroll inside a fixed height.

Integration with other components

Attach the menu to any element or component, and handle the select event to run actions, such as opening a Dialog for the chosen item.

Pure React Context Menu

A separate Syncfusion Pure React component library with its own Context Menu, built for React without the EJ2 wrapper. It is not part of the EJ2 features above.

Accessible, localized, and themed

WAI-ARIA menu roles, arrow, Enter, and Esc keys, right-to-left layouts, and localization. Bootstrap 5, Tailwind CSS, Fluent, and high-contrast themes are built in, and CSS classes restyle every part.

Get started

Get your first context menu running, with or without AI

With an AI coding assistant

  1. Connect the Syncfusion MCP serverWorks in VS Code, Cursor, JetBrains, and other MCP-compatible assistants.Set up the MCP server
  2. Add Agent Skills to your projectYour agent follows Syncfusion’s recommended Context Menu patterns.Install Agent Skills
  3. Describe the context menuCopy this prompt to start.

    Add a Syncfusion React Context Menu to my file list with Open, Rename, a Share submenu, and Delete, with icons and a separator.

By hand, in three steps

1 · Install

npm install @syncfusion/ej2-react-navigations @syncfusion/ej2-tailwind3-theme --save

2 · src/App.css

@import '../node_modules/@syncfusion/ej2-tailwind3-theme/styles/context-menu/index.css';

3 · src/App.tsx

import { ContextMenuComponent } from '@syncfusion/ej2-react-navigations';
import './App.css';

const items = [
  { text: 'Open', iconCss: 'e-icons e-folder-open' },
  { text: 'Rename', iconCss: 'e-icons e-edit' },
  { separator: true },
  { text: 'Delete', iconCss: 'e-icons e-trash' },
];

export default function App() {
  return (
    <>
      <div id="files">Right-click here</div>
      <ContextMenuComponent target="#files" items={items} />
    </>
  );
}
Read the getting started guide

Works withReact 15.5.4 or laterTypeScript and JavaScriptNext.jsRemixGatsbyVitePreactSystem requirements

Customer reviews

Trusted by developers and teams

G2

4.5/5

From 850+ reviews of Essential Studio®

Read the reviews on G2

“Awesome, enough said”

Easy usability, solving real-life problems, easy to implement. Most of the cases have the operators and settings possibilities you need right away.

Oliver O.Creative and Art Direction, Small Business

“A giant framework with great pricing options”

I have loved the components and options that Syncfusion has; besides, its documentation, demos, and support are excellent.

Alejandro Javier V.CEO, Small Business
75%
lower costs
50%
faster development

Customer story · Igniatek

Igniatek cuts development time 50% and costs 75% with Essential Studio®

“I would definitely recommend Syncfusion for anyone who is trying to develop something meaningful.”

Somnath Maji, Founder, Igniatek Consultancy

Award-winning

Including the 2026 Devies Award, Capterra Shortlist 2026, Software Advice FrontRunners 2026, and G2 Best Software 2025.

Syncfusion awards: 2026 Devies Award Winner, Capterra Shortlist 2026, Software Advice FrontRunners 2026, SaaS Awards 2026 Finalist, Hosting Advice Developers' Choice, A.I. Awards 2025 Finalist, Visual Studio Magazine Readers' Choice 2025 Gold, G2 Best Software 2025, ComponentSource Top 10 Publisher 2025, and TrustRadius Tech Cares 2025

Complete feature list

Every context menu feature, included in the license

  • Every feature includedNo separate enterprise edition
  • Royalty-freeNo runtime or deployment fees
  • Weekly patchesPlus regular feature releases
  • Expert supportFrom Syncfusion engineers

Showing all 34 features. Each one opens its demo or documentation.

Related navigation components:React Menu BarReact ToolbarReact Ribbon

Questions and answers

React Context Menu FAQ

What is the React Context Menu?

The Syncfusion React Context Menu is a popup menu that opens at the pointer when users right-click, or touch and hold, a target element. It lists the actions for that element. Explore the demos

What is the difference between the Context Menu and the Menu Bar?

The Context Menu opens on demand at the pointer for a specific element. The Menu Bar stays visible as a horizontal or vertical bar of app commands. React Menu Bar

How do I add a context menu in React?

Install @syncfusion/ej2-react-navigations and the Tailwind 3 theme, then render ContextMenuComponent with a target selector and an items array. The getting started section on this page shows each step. Read the getting started guide

Does the context menu work on touch devices?

Yes. It opens when users touch and hold the target, and on phones nested items show in a single layer. Read about nesting

Can I create nested submenus?

Yes. Give an item its own items array to nest submenus at any depth, opened on hover or, with showItemOnClick, on click. Read about multilevel nesting

Can I add icons and separators to menu items?

Yes. Set iconCss on an item for a font icon or image, and add an item with separator set to true to group items. Read about icons

Can I customize how menu items look?

Yes. Use itemTemplate to render items with any JSX, or the beforeItemRender event to add shortcuts or components to items. Template demo

Can the menu show different items for different elements?

Yes. In the beforeOpen event, read the target and call hideItems or showItems to fit the menu to it. Read about dynamic items

Can I disable or add items at run time?

Yes. Call enableItems to enable or disable items, and insertAfter, insertBefore, or removeItems to change the list. Read about adding and removing items

Can I open the context menu from code?

Yes. Call open with top and left coordinates to show the menu anywhere, and close to hide it. Read about opening from code

Is the React Context Menu accessible?

Yes. It follows WAI-ARIA practices and WCAG 2.2, with arrow, Enter, and Esc keys, screen reader support, and right-to-left layouts. Read about accessibility

Can AI coding assistants build with the React Context Menu?

Yes. The Syncfusion MCP server and Agent Skills give assistants in VS Code, Cursor, and JetBrains the current Context Menu docs and recommended patterns. You need a Syncfusion API key and an active license, which can be a commercial, Community, or trial license. Set up the MCP server

Is the Syncfusion React Context Menu free?

It is a commercial component with a 30-day free trial. A free Community License is available for companies and individuals with less than $1 million USD in annual gross revenue, five or fewer developers, and 10 or fewer total employees. Check Community License eligibility

Syncfusion React Context Menu

Build your React context menus faster with AI

The full Context Menu, the MCP server, and Agent Skills, free for 30 days.

  • No credit card required
  • Free Community License for eligible teams
  • No runtime or deployment fees