ToolbarToggleItem
An on/off button in an environment's toolbar, drawn pressed while active.
@internote/canvas-sdkimport { ToolbarToggleItem } from '@internote/canvas-sdk';#Fields
activeWhether the toggle is on.
booleandisabledWhether the toggle is shown but cannot be pressed.
booleaniconAn icon name, resolved by the host's icon set.
stringidUnique within the environment's contribution. A duplicate throws at validation.
stringlabelThe accessible name and tooltip.
stringonToggleCalled when the reader presses the toggle. The environment flips its own state.
() => voidtypeMarks the item as a toggle.
'toggle'#Example
{ type: 'toggle', id: 'grid', icon: 'Grid', label: 'Grid', active: showsGrid(ctx), onToggle: () => toggleGrid(ctx) }Declared in packages/canvas-sdk/src/toolbar/types.ts:72.