Weave.js

WeavePenToolAction

Add line segments to the canvas

Overview

The WeavePenToolAction class that allows users to draw precise, vector-based paths by clicking to place points and optionally closing or smoothing the resulting shape. Unlike the brush tool (which captures freehand strokes), the pen tool emphasizes structured line creation, making it ideal for diagrams, connectors, wireframes, and flow-based interactions.

Each completed path becomes a WeaveLineNode, synced in real time across all collaborators.

The class extends the WeaveAction class.

Name

This action name property value is penTool.

Import

import { WeavePenToolAction } from "@inditextech/weave-sdk";

Instantiation

new WeavePenToolAction();