MCPInstall

syncfusion-aspnetcore-context-menu

Implement Syncfusion ContextMenu component in ASP.NET Core applications to display contextual menus triggered by right-click or programmatic actions.

Installs
97
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/syncfusion/aspnetcore-ui-components-skills --skill syncfusion-aspnetcore-context-menu
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads syncfusion-aspnetcore-context-menu automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Implementing Syncfusion ContextMenu

When to Use This Skill

Use the ContextMenu component when you need to:

  • Display context-sensitive menus triggered by right-click or long-touch on target elements
  • Create nested multi-level menus with hierarchical menu item structures
  • Add icons and visual indicators to menu items using CSS icon classes
  • Implement navigation links within menu items to route to different pages
  • Handle menu item selection with programmatic or event-driven logic
  • Customize menu appearance with CSS classes, templates, and animations
  • Support keyboard navigation for accessible menu interactions
  • Enable scrollable menus for large numbers of menu items exceeding viewport
  • Apply animations to submenu transitions with multiple effect options
  • Persist component state between page reloads and maintain locale customization
  • Support RTL (right-to-left) rendering for international applications
  • Render custom item templates for complex menu item layouts beyond simple text

Component Overview

The Syncfusion ContextMenu is a lightweight navigation component that displays a list of commands or menu items in response to user interactions, typically a right-click on a target element. It provides:

  • Target-Based Triggering: Attach context menu to specific DOM elements via CSS selector
  • Multi-Level Nesting: Support for submenu items nested within parent menu items
  • Icon Support: Apply CSS icon classes (e.g., e-icons, Font Awesome) to menu items
  • Navigation Integration: Direct navigation via URL property on menu items
  • Rich Animations: Multiple transition effects (SlideDown, ZoomIn, FadeIn, None) with configurable duration
  • Scrollable Content: Enable vertical scrolling for menus exceeding viewport height
  • Template Customization: Define custom HTML templates for complex menu item layouts
  • Event System: Capture menu lifecycle events (beforeOpen, onOpen, select, beforeClose, onClose)
  • Item Rendering Hooks: Use beforeItemRender event to customize individual items per render
  • Selector Filtering: Filter target elements within a container using CSS selector patterns
  • Hover Delay: Configure delay duration before submenu appears on hover
  • State Persistence: Automatically restore component state on page reloads
  • Locale Support: Override global culture for component-specific localization
  • RTL Support: Automatic right-to-left rendering for RTL languages
  • HTML Sanitization: Optional sanitization of untrusted HTML content in menu items
  • Submenu Behavior: Control whether submenus open on hover or click-only

Documentation and Navigation Guide

Getting Started

📄 Read: references/getting-started.md

  • Prerequisites and ASP.NET Core project setup
  • NuGet package installation (Syncfusion.EJ2.AspNet.Core)
  • TagHelper registration in _ViewImports.cshtml
  • Stylesheet and script resource references
  • Script Manager registration
  • Basic ContextMenu implementation with target element
  • Rendering first context menu with simple menu items
  • Initial data binding with items property

Menu Items and Data Binding

📄 Read: references/menu-items-and-data-binding.md

  • MenuItem structure and required properties (text, id)
  • Data binding patterns using List and JSON objects
  • Menu item properties: text, id, separator, iconCss, items, url
  • Creating single-level and multi-level nested menus
  • Separator usage for visual grouping (separator: true)
  • Dynamic menu item updates and modifications
  • Local data source patterns and data transformation

Icons, Navigation, and Customization

📄 Read: references/icons-navigation-customization.md

  • iconCss property for adding icons to menu items
  • e-icons CSS class for Syncfusion built-in icons
  • URL property for navigation links in menu items
  • Creating action vs navigation menu items
  • Custom CSS classes for styling menu items (cssClass property)
  • Hover delay configuration (hoverDelay property)
  • Filter selector for target element matching (filter property)

Animation and Scrolling

📄 Read: references/animation-scrolling.md

  • animationSettings configuration for submenu transitions
  • Animation effects: None, SlideDown, ZoomIn, FadeIn
  • Duration and easing properties for animation timing
  • enableScrolling property for handling large menu lists
  • Vertical scrolling behavior for overflow menu items
  • BeforeOpen event for dynamic menu height adjustment
  • Performance considerations for scrollable menus

Templates and Custom Rendering

📄 Read: references/templates-customization.md

  • itemTemplate property for custom menu item layouts
  • beforeItemRender event for individual item customization
  • Rendering custom HTML within menu items
  • Adding UI components (checkboxes, inputs) to menu items
  • Event arguments in beforeItemRender (name property in MenuEventArgs)
  • Dynamic item HTML generation based on data
  • CSS customization through rendered elements

Event Handling and Integration

📄 Read: references/event-handling.md

  • select event for menu item selection/click handling
  • beforeOpen event triggered before submenu opens
  • beforeClose event triggered before menu closes
  • onOpen event triggered when submenu is opened
  • onClose event triggered when menu closes
  • beforeItemRender event for render-time customization
  • created event indicating component initialization complete
  • Event-driven menu operations and conditional logic

Quick Start Example

Razor Markup (Index.cshtml):

@page
@model IndexModel

<div id="target">Right-click me</div>

<ejs-contextmenu id="contextmenu" target="#target" items="Model.MenuItems"></ejs-contextmenu>

PageModel (Index.cshtml.cs):

public class IndexModel : PageModel
{
    public List<object> MenuItems { get; set; }
    
    public void OnGet()
    {
        MenuItems = new List<object>
        {
            new { text = "Cut", id = "cut", iconCss = "e-icons e-cut" },
            new { text = "Copy", id = "copy", iconCss = "e-icons e-copy" },
            new { text = "Paste", id = "paste", iconCss = "e-icons e-paste" },
            new { separator = true },
            new { 
                text = "Font", 
                id = "font",
                items = new List<object>
                {
                    new { text = "Bold", id = "bold" },
                    new { text = "Italic", id = "italic" }
                }
            }
        };
    }
}

Common Patterns

PatternUse CaseReference
Right-Click MenuContext menu triggered by mouse right-clickgetting-started.md
Hierarchical ItemsMulti-level nested menu structuremenu-items-and-data-binding.md
Icon SupportMenu items with visual iconsicons-navigation-customization.md
Navigation LinksMenu items as navigation shortcutsicons-navigation-customization.md
Animated TransitionsSubmenu appearance effectsanimation-scrolling.md
Scrollable MenusLarge menu lists with overflowanimation-scrolling.md
Custom TemplatesComplex item layoutstemplates-customization.md
Selection HandlingReact to item selectionevent-handling.md
Hover DelayControl submenu timingicons-navigation-customization.md
RTL SupportRight-to-left language renderinggetting-started.md

Key Properties

PropertyTypePurposeExample
targetstringCSS selector for target element"#menuTarget" or ".menu-area"
itemsMenuItemModel[]Array of menu item definitionsList of objects with text, id properties
animationSettingsMenuAnimationSettingsModelSubmenu open animation configeffect: "ZoomIn", duration: 500
enableScrollingbooleanEnable vertical scrolling for overflowtrue for large menus
hoverDelaynumberDelay in ms before submenu opens on hover500
showcItemOnClickbooleanSubmenu opens only on clicktrue to disable hover opening
itemTemplatestring or FunctionCustom HTML template for itemsHTML string or callback function
cssClassstringCSS class for menu wrapper styling"custom-context-menu dark-theme"
filterstringCSS selector to filter target elements".menu-enabled"
enableRtlbooleanRight-to-left renderingtrue
enablePersistencebooleanPreserve state on page reloadtrue
localestringComponent locale override"fr-FR"
enableHtmlSanitizerbooleanSanitize untrusted HTMLtrue (recommended for user content)

Common Use Cases

1. File Manager Context Menu Attach context menu to file list for Cut, Copy, Paste, Delete, Rename operations with icons.

2. Text Editor Toolbar Provide right-click access to formatting options (Bold, Italic, Underline) and text manipulation.

3. Data Grid Row Actions Context menu on grid rows for Edit, View, Delete, Export operations on selected rows.

4. Navigation Shortcuts Quick access menu providing links to different application sections or external resources.

5. Multi-Language Support Configure locale-specific formatting and override default culture for globalized applications.


Next Steps

  • Review the API Reference for complete property and method documentation
  • Combine ContextMenu with other navigation components (Toolbar, Sidebar) for comprehensive UI
  • Implement keyboard shortcuts alongside context menu for enhanced accessibility
  • Test RTL rendering if targeting international audiences
  • Consider performance implications when rendering large menu lists (>100 items)

FAQ

What does the syncfusion-aspnetcore-context-menu skill do?

Implement Syncfusion ContextMenu component in ASP.NET Core applications to display contextual menus triggered by right-click or programmatic actions.

How do I install syncfusion-aspnetcore-context-menu?

Run npx skills add https://github.com/syncfusion/aspnetcore-ui-components-skills --skill syncfusion-aspnetcore-context-menu in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/syncfusion-aspnetcore-context-menu/ (personal) or .claude/skills/syncfusion-aspnetcore-context-menu/ (project).

Which AI agents can use syncfusion-aspnetcore-context-menu?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is syncfusion-aspnetcore-context-menu safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains syncfusion-aspnetcore-context-menu?

It is published by syncfusion in syncfusion/aspnetcore-ui-components-skills. It has 97 recorded installs.

More from syncfusion/aspnetcore-ui-components-skills

View all →

syncfusion-aspnetcore-charts

syncfusion/aspnetcore-ui-components-skills

Open the skill to read its SKILL.md instructions.

Frontend & Design112 installs

syncfusion-aspnetcore-common

syncfusion/aspnetcore-ui-components-skills

Open the skill to read its SKILL.md instructions.

Frontend & Design111 installs

syncfusion-aspnetcore-license

syncfusion/aspnetcore-ui-components-skills

Open the skill to read its SKILL.md instructions.

Frontend & Design111 installs

syncfusion-aspnetcore-grid

syncfusion/aspnetcore-ui-components-skills

Open the skill to read its SKILL.md instructions.

Frontend & Design110 installs

syncfusion-aspnetcore-gantt-chart

syncfusion/aspnetcore-ui-components-skills

Open the skill to read its SKILL.md instructions.

Frontend & Design108 installs

syncfusion-aspnetcore-security

syncfusion/aspnetcore-ui-components-skills

Open the skill to read its SKILL.md instructions.

Security108 installs

Popular frontend & design skills

View category →

setup-matt-pocock-skills

mattpocock/skills

Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.

Frontend & Design1.1M installs

frontend-design

anthropics/skills

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

OfficialFrontend & Design1M installs

hyperframes-animation

heygen-com/hyperframes

All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.

prototype

mattpocock/skills

Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.

Frontend & Design999.2K installs

hyperframes-core

heygen-com/hyperframes

The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.

Frontend & Design930.5K installs

vercel-react-best-practices

vercel-labs/agent-skills

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

OfficialFrontend & Design843.1K installs