Skip to main content

sdk.activetool

Home > @kittl/sdk > ActiveTool

ActiveTool type

Represents the currently active tool in the editor (artboard, move, pen, comment, shape, etc.).

Signature:

export type ActiveTool = 
/**
* Clicking and dragging on the canvas will create a new artboard.
*
* - Cursor: crosshair.
* - Disabled if canvas is in asset mode (focus mode or loading focus mode).
* - Commonly used for adding new artboards to a design.
*/
{
type: 'artboard';
}
/**
* Default selection/move tool.
*
* - Clicking selects objects.
* - Dragging moves selected objects.
* - If switching from pen tool to move and the last drawn object is a basic shape,
* it transitions into L2 vector editing for that object.
* - Cursor: default arrow.
*/
| {
type: 'move';
}
/**
* Pen drawing tool for creating freehand vector paths.
*
* - Clicking and dragging draws new paths.
* - Has special handling when a single vector object is selected:
* may switch to 'pen-vector-editing' unless `force` is true.
* - Cursor: pen icon.
* - Activates analytics tracking for pen usage.
*/
| {
type: 'pen';
}
/**
* Vector editing mode for modifying an existing single vector path.
*
* - Allows adding/removing anchor points directly on the path.
* - Triggered when switching to pen tool with a single vector object selected.
* - Will unfold grouped vectors and select the actual path object.
* - If the selected object is not editable, falls back to 'move' tool.
* - Cursor: same as pen.
*/
| {
type: 'pen-vector-editing';
}
/**
* Comment placement tool.
*
* - Clicking on the canvas adds a comment marker at the clicked position.
* - Cursor: comment mode cursor (from COMMENT_CURSOR_CONFIG).
* - Automatically enables comment mode in the comment store.
*/
| {
type: 'comment';
}
/**
* Shape creation tool.
*
* - Clicking and dragging creates a new shape of the given type.
* - Cursor: crosshair.
* - Shape type determines the geometry (rectangle, ellipse, polygon, etc.).
*/
| {
type: 'shape';
shape: BasicShapeType;
};

References: BasicShapeType