Context Menu @astryx-svelte/core v0.3.0 · ContextMenu
Usage
A right-click context menu that appears at the cursor position. Use to provide contextual actions for specific elements or regions without cluttering the UI with visible buttons.tsimport { ContextMenu } from '@astryx-svelte/core';
Best practices
| Guidance | Practices |
|---|---|
| Do | Keep menu items concise and action-oriented; users expect quick access to contextual actions. |
| Do | Use sections and dividers to group related actions when the menu has many items. |
| Do | Ensure all context menu actions are also accessible via other UI elements for keyboard-only users. |
| Don't | Use a ContextMenu as the only way to access important actions; not all users know to right-click. |
| Don't | Place more than 10–12 items in a single menu without grouping them into sections. |
Examples
Common configurations, variations, and states.ContextMenu — Basic
A right-click area with action items and a divider separating a destructive action. Use to provide contextual actions for a specific element or region.