Interface: MenuItem
Defined in: packages/sdk/src/ui-service.ts:47
One actionable row in a menu shown by UiService.showMenu. The host renders and themes the chrome; the extension supplies the data and an action.
Properties
label
label: string;Defined in: packages/sdk/src/ui-service.ts:49
The row's text.
accelerator?
optional accelerator?: string;Defined in: packages/sdk/src/ui-service.ts:55
A pre-formatted shortcut hint shown right-aligned, e.g. "⌘C" or "Ctrl+C". Display only — it does not bind the key. Format it for the platform yourself.
icon?
optional icon?: ReactNode;Defined in: packages/sdk/src/ui-service.ts:57
Leading glyph (e.g. a Phosphor icon element).
checked?
optional checked?: boolean;Defined in: packages/sdk/src/ui-service.ts:59
Show a check in the leading gutter — for toggle / current-selection rows.
disabled?
optional disabled?: boolean;Defined in: packages/sdk/src/ui-service.ts:61
Render the row dimmed and inert.
danger?
optional danger?: boolean;Defined in: packages/sdk/src/ui-service.ts:63
Style the row as destructive (e.g. Delete).
title?
optional title?: string;Defined in: packages/sdk/src/ui-service.ts:65
Native tooltip for the row.
trailing?
optional trailing?: MenuItemTrailing;Defined in: packages/sdk/src/ui-service.ts:67
A secondary trailing control (see MenuItemTrailing).
submenu?
optional submenu?: MenuEntry[];Defined in: packages/sdk/src/ui-service.ts:75
A nested menu that cascades open to the side when this row is hovered or clicked. A row with a submenu is a parent: it shows a trailing caret and opening it reveals these entries rather than running an action. Give a row a submenu or a run, not both (a run is ignored while the submenu is the active target).
run?
optional run?: () => void | Promise<void>;Defined in: packages/sdk/src/ui-service.ts:81
Invoked when the row is chosen; the menu closes first. Optional only for submenu parents (rows with a submenu); every leaf row must supply one.
Returns
void | Promise<void>