Weave.js

WeaveRectangleToolAction

Add a rectangle to the canvas

Overview

The WeaveRectangleToolAction class that allows users to create rectangle shapes on the canvas by clicking and dragging. It provides a smooth, intuitive way to add structured, resizable rectangular elements that can serve as building blocks for diagrams, layouts, mockups, and more.

Each interaction results in the creation of a WeaveRectangleNode, added to the shared state and synchronized across all users.

The class extends the WeaveAction class.

Name

This action name property value is rectangleTool.

Import

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

Instantiation

new WeaveRectangleToolAction();