Interface: ToolbarItemFields<S>
Defined in: packages/sdk/src/toolbar-items.ts:43
Shared fields for interactive toolbar contributions. Render chrome is driven by icon + title:
| icon | title | Control |
|---|---|---|
| ✓ | — | icon-only |
| — | ✓ | text-only |
| ✓ | ✓ | icon + text |
Icons are Phosphor export names (PhosphorIconName); the host resolves and paints them bold at 1em so they match local-web-viewer and track UI zoom. Pass a React node is no longer supported — use the name.
Extended by
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.
surface
surface: S;Defined in: packages/sdk/src/toolbar-items.ts:47
Which toolbar to contribute to.
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).
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.
tooltip?
optional tooltip?: string;Defined in: packages/sdk/src/toolbar-items.ts:59
Hover tooltip (falls back to title / label / command label).
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.
order?
optional order?: number;Defined in: packages/sdk/src/toolbar-items.ts:67
Ordering within the trailing cluster; lower sorts first.
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
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