ShapeContainerMixin.createRectangle

Creates a new rectangle shape in this container

ShapeContainerMixin.createRectangle() method

Creates a new rectangle shape in this container

Signature:

createRectangle(opts?: RectangleOptions): Rectangle;

Parameters

Parameter

Type

Description

opts

RectangleOptions

(Optional) Optional configuration for the rectangle

Returns:

Rectangle

The newly created rectangle

Example

// Create a rectangle shape
const rectangle = await layer.createRectangle({
  position: { x: 100, y: 100 },
  size: { width: 200, height: 100 },
  roundness: 10,
});
Last updated: August 5, 2026 at 11:47 AMEdit this page