apps/ui-kit/docs/api/menu-item.md
For examples and usage details, visit Context Menu page.
The MenuItem type defines the structure of items in a menu, including labels,
handlers, shortcuts, and additional properties such as checkboxes and dividers.
| Property | Type | Description | Default |
|---|---|---|---|
label<sup>required</sup> | string | { html: string } | Menu item label, can be plain text or HTML. Please only use raw html if you trust the source. | |
handler<sup>required</sup> | function | Function executed when item is clicked | |
id | string | Unique identifier | undefined |
class | string | CSS class for styling | undefined |
shortcut | string | string[] | Keyboard shortcut | undefined |
disabled | boolean | Whether the item is disabled | false |
items | MenuItem[] | Submenu items | undefined |
keepOpen | boolean | Keeps menu open after clicking | false |
When checked is defined, the item becomes a checkbox item.
| Property | Type | Description | Default |
|---|---|---|---|
label<sup>required</sup> | string | { html: string } | Menu item label | |
handler<sup>required</sup> | function | Function executed when item is clicked | |
checked<sup>required</sup> | boolean | Checkbox state | |
id | string | Unique identifier | undefined |
class | string | CSS class for styling | undefined |
shortcut | string | string[] | Keyboard shortcut | undefined |
disabled | boolean | Whether the item is disabled | false |
items | MenuItem[] | DividerItem[] | Submenu items | undefined |
keepOpen | boolean | Keeps menu open after clicking | false |
| Property | Type | Description | Default |
|---|---|---|---|
type<sup>required</sup> | 'divider' | Creates a visual separator |