Skip to content

MenuItem

Defined in: widgets/controls/menu.ts:20

One row in a MenuListWidget. An action row has a label; a row with separator: true is a non-interactive divider (its other fields are ignored). A row with a submenu opens a nested menu instead of firing onSelect.

optional danger?: boolean

Defined in: widgets/controls/menu.ts:30

Draw in the theme $error colour — for destructive actions.


optional disabled?: boolean

Defined in: widgets/controls/menu.ts:28

Dim and unselectable (skipped by keyboard nav and clicks).


optional icon?: string

Defined in: widgets/controls/menu.ts:26

Leading glyph drawn before the label (one or two cells).


optional label?: string

Defined in: widgets/controls/menu.ts:22

Action text. Omit only when separator is set.


optional separator?: boolean

Defined in: widgets/controls/menu.ts:32

Render as a horizontal divider instead of an action row.


optional shortcut?: string

Defined in: widgets/controls/menu.ts:24

Right-aligned hint, typically a shortcut (“Ctrl+C”, “⌘V”). Ignored when submenu is set.


optional submenu?: MenuItem[]

Defined in: widgets/controls/menu.ts:34

Nested rows; the row shows a and opens this menu to the side instead of selecting.


optional value?: unknown

Defined in: widgets/controls/menu.ts:36

Opaque payload handed back via onSelect (defaults to the row index).