Skip to content

Interface: ToolbarCommandItemContribution<S>

Defined in: packages/sdk/src/toolbar-items.ts:86

Command-backed toolbar control — click runs ToolbarCommandItemContribution.command.

Extends

Type Parameters

S

S extends ToolbarSurface = ToolbarSurface

Properties

id

ts
id: string;

Defined in: packages/sdk/src/toolbar-items.ts:45

Unique id for this contribution.

Inherited from

ToolbarItemFields.id


surface

ts
surface: S;

Defined in: packages/sdk/src/toolbar-items.ts:47

Which toolbar to contribute to.

Inherited from

ToolbarItemFields.surface


icon?

ts
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

ToolbarItemFields.icon


title?

ts
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

ToolbarItemFields.title


tooltip?

ts
optional tooltip?: string;

Defined in: packages/sdk/src/toolbar-items.ts:59

Hover tooltip (falls back to title / label / command label).

Inherited from

ToolbarItemFields.tooltip


label?

ts
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

ToolbarItemFields.label


order?

ts
optional order?: number;

Defined in: packages/sdk/src/toolbar-items.ts:67

Ordering within the trailing cluster; lower sorts first.

Inherited from

ToolbarItemFields.order


when?

ts
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

ContextKeys

target

ToolbarItemContext[S]

Returns

boolean

Inherited from

ToolbarItemFields.when


checked?

ts
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

ContextKeys

target

ToolbarItemContext[S]

Returns

boolean

Inherited from

ToolbarItemFields.checked


command

ts
command: string;

Defined in: packages/sdk/src/toolbar-items.ts:90

The command to run; receives ToolbarItemContext[S] as its first arg.


ts
optional menu?: undefined;

Defined in: packages/sdk/src/toolbar-items.ts:91


type?

ts
optional type?: undefined;

Defined in: packages/sdk/src/toolbar-items.ts:92