Interface: ToolbarMenuItemContribution<S>
Defined in: packages/sdk/src/toolbar-items.ts:103
Menu-backed toolbar control — click opens a host dropdown via UiService.showMenu with entries from ToolbarMenuItemContribution.menu.
Extends
Type Parameters
S
S extends ToolbarSurface = ToolbarSurface
Properties
id
id: string;Defined in: packages/sdk/src/toolbar-items.ts:45
Unique id for this contribution.
Inherited from
surface
surface: S;Defined in: packages/sdk/src/toolbar-items.ts:47
Which toolbar to contribute to.
Inherited from
icon?
optional icon?: string;Defined in: packages/sdk/src/toolbar-items.ts:52
Leading glyph as a PhosphorIconName (e.g. "Flag"). Omit for a text-only control (requires title).
Inherited from
title?
optional title?: string;Defined in: packages/sdk/src/toolbar-items.ts:57
Visible label painted in the control. Omit for icon-only. When both icon and title are set, the host renders icon + text.
Inherited from
tooltip?
optional tooltip?: string;Defined in: packages/sdk/src/toolbar-items.ts:59
Hover tooltip (falls back to title / label / command label).
Inherited from
label?
optional label?: string;Defined in: packages/sdk/src/toolbar-items.ts:65
Accessible name (falls back to title / the command's label). Always used for aria-label; not painted unless title is also set.
Inherited from
order?
optional order?: number;Defined in: packages/sdk/src/toolbar-items.ts:67
Ordering within the trailing cluster; lower sorts first.
Inherited from
when?
optional when?: (ctx, target) => boolean;Defined in: packages/sdk/src/toolbar-items.ts:71
Visibility predicate. Returning false hides the item for this target.
Parameters
ctx
target
Returns
boolean
Inherited from
checked?
optional checked?: (ctx, target) => boolean;Defined in: packages/sdk/src/toolbar-items.ts:77
Toggle-state predicate for command items. When provided, the host renders the control in a pressed/checked visual state whenever this returns true. Menu items put checks on individual MenuEntry rows instead.
Parameters
ctx
target
Returns
boolean
Inherited from
menu
menu: (target) =>
| MenuEntry[]
| Promise<MenuEntry[]>;Defined in: packages/sdk/src/toolbar-items.ts:110
Build the dropdown for this target. May be sync or async. The host anchors the menu on the toolbar control (align: "end", toggle on).
Parameters
target
Returns
| MenuEntry[] | Promise<MenuEntry[]>
command?
optional command?: undefined;Defined in: packages/sdk/src/toolbar-items.ts:111
type?
optional type?: undefined;Defined in: packages/sdk/src/toolbar-items.ts:112