ContextMenuItem
Context menu item definition. Supports icons, shortcuts, submenus, separators, and dynamic disabled/hidden states.
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
id | string | Unique identifier for the menu item |
name | string | Display label for the menu item |
icon? | string | Optional icon (HTML string, emoji, or icon class) |
shortcut? | string | string[] | Optional keyboard shortcut hint (display only). String array renders as key combo (e.g. [‘Ctrl’, ‘A’] → <code>Ctrl</code>+<code>A</code>) |
disabled? | boolean | (params: ContextMenuParams) => boolean | Whether the item is disabled (static or dynamic) |
hidden? | boolean | (params: ContextMenuParams) => boolean | Whether the item is hidden (static or dynamic) |
action? | (params: ContextMenuParams) => void | Action handler when the item is clicked |
subMenu? | ContextMenuItem[] | Nested submenu items |
separator? | boolean | Whether this is a separator (id and name required but ignored) |
cssClass? | string | Optional CSS class to add to the menu item |
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt