Skip to content

Command

An action with a label, shown on the toolbar, in More, or in the cell menu.

Property Type Description
icon? string -
id string Unique within the plugin.
label PluginText -
where "toolbar" | "more" | "cellMenu" -
optional enabled(context): boolean;

Read again whenever the editor’s state changes, or the plugin calls commands.refresh().

Parameter Type
context CommandContext

boolean


optional preload(): void;

Called when the menu holding it opens, or the pointer rests on it: load an SDK here.

void


run(context): void | Promise<void>;

Runs inside the click, so a popup it opens straight away isn’t blocked.

Parameter Type
context CommandContext

void | Promise<void>


optional visible(context): boolean;
Parameter Type
context CommandContext

boolean