@jimka/typescript-ui / component/container / MenuItemConfig
Interface: MenuItemConfig
Defined in: src/typescript/lib/component/container/MenuItem.ts:40
Describes a leaf action item, submenu trigger, or separator row inside a Menu.
Remarks
When separator is true all other fields are ignored; the item renders as a thin horizontal rule. When submenu is set the item opens a child Menu instead of calling action.
Properties
action()?
optional action: () => void;Defined in: src/typescript/lib/component/container/MenuItem.ts:44
Called when the item is activated (click or Enter). Ignored when submenu is set.
Returns
void
enabled?
optional enabled: boolean;Defined in: src/typescript/lib/component/container/MenuItem.ts:46
Defaults to true. Disabled items are dimmed and non-interactive.
glyph?
optional glyph: string;Defined in: src/typescript/lib/component/container/MenuItem.ts:61
Registry glyph name displayed on the left of the item row. Takes precedence over icon when both are provided.
icon?
optional icon: string;Defined in: src/typescript/lib/component/container/MenuItem.ts:56
Icon displayed on the left (e.g. a Unicode character).
Remarks
Prefer glyph for crisp SVG output from the framework's glyph registry; icon remains supported for callers that want to embed a raw character.
separator?
optional separator: true;Defined in: src/typescript/lib/component/container/MenuItem.ts:65
When true the item renders as a separator; all other fields are ignored.
shortcut?
optional shortcut: string;Defined in: src/typescript/lib/component/container/MenuItem.ts:48
Keyboard shortcut hint displayed on the right (e.g. "Ctrl+S").
submenu?
optional submenu: MenuConfig;Defined in: src/typescript/lib/component/container/MenuItem.ts:63
When present this item opens a submenu rather than calling action.
text?
optional text: string;Defined in: src/typescript/lib/component/container/MenuItem.ts:42
Display label shown in the menu row.