ToolbarToggleItem

An on/off button in an environment's toolbar, drawn pressed while active.

@internote/canvas-sdkInterface
On this page
import { ToolbarToggleItem } from '@internote/canvas-sdk';

#Fields

activeRequired
Whether the toggle is on.
boolean
disabled
Whether the toggle is shown but cannot be pressed.
boolean
icon
An icon name, resolved by the host's icon set.
string
idRequired
Unique within the environment's contribution. A duplicate throws at validation.
string
label
The accessible name and tooltip.
string
onToggleRequired
Called when the reader presses the toggle. The environment flips its own state.
() => void
typeRequired
Marks 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.

Last updated