AI Notice: Most documentation right now was auto-generated by an LLM. Handwritten documentation will be implemented over time on the road to 1.0
ToolbarButtonDefinition
Toolbar button definition
Signature
interface ToolbarButtonDefinition {
id: string;
label: string;
icon?: string | ((ctx: ToolbarContext) => string);
shortcut?: ItemShortcutConfig;
action: (ctx: ToolbarContext) => void | Promise<void>;
disabled?: (ctx: ToolbarContext) => boolean;
hidden?: (ctx: ToolbarContext) => boolean;
active?: (ctx: ToolbarContext) => boolean;
fixed?: boolean;
priority?: number;
}Members
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | — |
label | string | yes | — |
icon | string | (ctx: ToolbarContext) => string | no | — |
shortcut | ItemShortcutConfig | no | Shortcut configuration for this button |
action | (ctx: ToolbarContext) => void | Promise<void> | yes | — |
disabled | (ctx: ToolbarContext) => boolean | no | — |
hidden | (ctx: ToolbarContext) => boolean | no | — |
active | (ctx: ToolbarContext) => boolean | no | — |
fixed | boolean | no | If true, cannot be removed in edit mode |
priority | number | no | Higher priority items stay visible longer when collapsing (default 0) |