
syncfusion-javascript-context-menu
A comprehensive guide for implementing Syncfusion TypeScript ContextMenu component. Use this skill when building context menus that appear on right-click or touch-hold, including features like nested menus, dynamic items, animations, events, styling, and data binding. This skill covers everything from basic setup to advanced features like scrolling, accessibility, and custom templates.
- Installs
- 58
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/syncfusion/javascript-ui-controls-skills --skill syncfusion-javascript-context-menu- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads syncfusion-javascript-context-menu automatically when relevant.
- 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 ContextMenu
The ContextMenu is a graphical user interface component that appears on user right-click/touch-hold action. It provides support for nested menu items, custom templates, dynamic content, animations, and comprehensive event handling—making it ideal for building contextual actions in web applications.
Key Features
- Nested/Multilevel Menus - Create hierarchical menu structures
- Dynamic Item Management - Add, remove, enable, or disable items at runtime
- Rich Styling & Templates - Custom CSS, icons, and HTML templates
- Event Handling - Complete lifecycle events (beforeOpen, onOpen, onClose, select, etc.)
- Animations - Configurable opening/closing animations with multiple effects
- Data Binding - Populate menus from data sources
- Scrolling - Automatic scrolling for large menus with HScroll/VScroll
- Accessibility - WCAG compliance, keyboard navigation, ARIA support
- RTL Support - Right-to-left layout for international applications
Documentation and Navigation Guide
Getting Started
📄 Read: references/getting-started.md
- Install dependencies and configure development environment
- Add ContextMenu to your project
- Basic component initialization with HTML and TypeScript
- First working example with separators
- Running and testing your application
Menu Structure & Templates
📄 Read: references/menu-structure.md
- Create template-based menu structures
- Build multilevel and nested menus
- Define separators and item grouping
- Configure FieldSettings for data mapping
- Custom item structure patterns
Menu Items Management
📄 Read: references/menu-items.md
- Dynamically add or remove menu items
- Enable and disable items programmatically
- Use insertBefore() and insertAfter() methods
- Manage item state and visibility
- Batch item operations
Interactions & Events
📄 Read: references/interactions.md
- Open and close ContextMenu programmatically
- Handle lifecycle events (beforeOpen, onOpen, onClose, beforeClose)
- Respond to item selection (select event)
- Integrate dialogs triggered by menu clicks
- Configure animation effects and timing
- Manage menu positioning and hover delays
Styling & Appearance
📄 Read: references/styling.md
- Apply CSS styling and custom themes
- Add icons to menu items with iconCss
- Implement URL navigation with href
- Enable right-to-left (RTL) layout
- Apply custom CSS classes
- Format text with underline characters
Data Binding
📄 Read: references/data-binding.md
- Populate menus from data sources
- Bind to JSON arrays and collections
- Update menu items dynamically from server
- Map data fields using FieldSettings
- Real-time menu content updates
Advanced Features
📄 Read: references/advanced-features.md
- Implement scrollable menus with HScroll/VScroll
- Configure MenuOpenType (Auto, Hover, Click)
- Apply element filters for selective menu triggering
- Enable/disable HTML sanitization for security
- Configure persistence and locale settings
- Accessibility features and ARIA attributes
API Reference
📄 Read: references/api-reference.md
- Complete property documentation (~40 core properties)
- MenuItem structure and configuration
- Available methods (open, close, enableItems, removeItems, hideItems, etc.)
- Event interfaces and event data structures
- Animation effects and menu open types
- Type definitions and enums
Quick Start Example
HTML:
<div>
<div id="contextmenutarget" style="border: 1px solid #ccc; padding: 20px; width: 300px; height: 200px;">
Right-click here to open the context menu
</div>
<ul id="contextmenu"></ul>
</div>
TypeScript:
import { ContextMenu } from '@syncfusion/ej2-navigations';
// Define menu items
const menuItems = [
{ text: 'Cut' },
{ text: 'Copy' },
{ text: 'Paste' },
{ separator: true },
{ text: 'Link' },
{ text: 'Share' }
];
// Initialize ContextMenu
const contextMenu = new ContextMenu({
items: menuItems,
target: '#contextmenutarget'
});
contextMenu.appendTo('#contextmenu');
Common Patterns
Pattern 1: Nested Menu Structure
const menuItems = [
{
text: 'Edit',
items: [
{ text: 'Cut' },
{ text: 'Copy' },
{ text: 'Paste' }
]
},
{
text: 'View',
items: [
{ text: 'Zoom In' },
{ text: 'Zoom Out' }
]
}
];
const contextMenu = new ContextMenu({
items: menuItems,
target: '#target'
});
Pattern 2: Handling Menu Item Selection
const contextMenu = new ContextMenu({
items: menuItems,
target: '#target',
select: (args) => {
console.log('Selected: ' + args.item.text);
// Perform action based on selected item
}
});
Pattern 3: Dynamic Item Addition
// Add new items after initialization
const newItems = [{ text: 'New Option' }];
contextMenu.insertAfter(newItems, 'Edit');
Pattern 4: Animation Configuration
const contextMenu = new ContextMenu({
items: menuItems,
target: '#target',
animationSettings: {
duration: 400,
easing: 'ease',
effect: 'SlideDown' // SlideDown, ZoomIn, FadeIn, etc.
}
});
Pattern 5: Icons and Navigation
const menuItems = [
{
text: 'Edit',
iconCss: 'e-icons e-edit'
},
{
text: 'Delete',
iconCss: 'e-icons e-delete'
},
{
text: 'External Link',
url: 'url'
}
];
Key Properties
| Property | Type | Purpose |
|---|---|---|
items | MenuItemModel[] | Menu items configuration |
target | string | CSS selector for triggering element |
animationSettings | MenuAnimationSettingsModel | Animation behavior |
cssClass | string | Custom CSS classes |
enableScrolling | boolean | Enable scrollbar for long menus |
enableRtl | boolean | Right-to-left layout support |
showItemOnClick | boolean | Submenu opens on click (vs hover) |
hoverDelay | number | Delay before submenu appears (ms) |
filter | string | CSS selector to filter target elements |
itemTemplate | string/Function | Custom template for menu items |
Common Use Cases
- File Operations - Cut, Copy, Paste, Delete on files/folders
- Editor Menus - Formatting options in text editors
- Grid Row Actions - Actions on table/grid rows
- Application Menus - General app context menus
- Nested Actions - Multi-level operations (Edit → Format)
- Dynamic Content - Load menu items from server
- Custom Styling - Themed context menus matching app design
- Accessibility - Keyboard navigation and screen reader support
FAQ
What does the syncfusion-javascript-context-menu skill do?
A comprehensive guide for implementing Syncfusion TypeScript ContextMenu component. Use this skill when building context menus that appear on right-click or touch-hold, including features like nested menus, dynamic items, animations, events, styling, and data binding. This skill covers everything from basic setup to advanced features like scrolling, accessibility, and custom templates.
How do I install syncfusion-javascript-context-menu?
Run npx skills add https://github.com/syncfusion/javascript-ui-controls-skills --skill syncfusion-javascript-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-javascript-context-menu/ (personal) or .claude/skills/syncfusion-javascript-context-menu/ (project).
Which AI agents can use syncfusion-javascript-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-javascript-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-javascript-context-menu?
It is published by syncfusion in syncfusion/javascript-ui-controls-skills. It has 58 recorded installs.
More from syncfusion/javascript-ui-controls-skills
syncfusion-javascript-grid
syncfusion/javascript-ui-controls-skills
Implements Syncfusion JavaScript Grid component for feature-rich data tables and grids. Use this when working with data display, sorting, filtering, grouping, aggregates, editing, or exporting. This skill covers grid configuration, CRUD operations, virtual scrolling, hierarchy grids, state persistence, and advanced data management features for data-intensive applications.
syncfusion-javascript-common
syncfusion/javascript-ui-controls-skills
Common utilities and features for Syncfusion JavaScript controls. Use this skill when the user needs to implement animations, drag-and-drop, state persistence, RTL support, localization, globalization, security, templates, and advanced features for Syncfusion JavaScript controls.
syncfusion-javascript-dropdowns
syncfusion/javascript-ui-controls-skills
Comprehensive guide for implementing Syncfusion TypeScript dropdown components including AutoComplete, ComboBox, Mention, Dropdownlist, Multiselect, ListBox, and MultiColumn ComboBox. Use this when building selection interfaces, data binding, filtering, cascading dropdowns, dual list transfer, custom templates, and accessible dropdown experiences.
syncfusion-javascript-license
syncfusion/javascript-ui-controls-skills
Open the skill to read its SKILL.md instructions.
syncfusion-javascript-popups
syncfusion/javascript-ui-controls-skills
Open the skill to read its SKILL.md instructions.
syncfusion-javascript-tab
syncfusion/javascript-ui-controls-skills
This skill enables creating and customizing Syncfusion TypeScript Tab components, including tab navigation, tab headers, styling, responsive layouts, dynamic content loading, animations, and multi-panel organization.
Popular frontend & design skills
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-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.
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.
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.
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.