ShapeContainerMixin.createGroup

Creates a new group containing the specified shapes

ShapeContainerMixin.createGroup() method

Creates a new group containing the specified shapes

Signature:

createGroup(opts?: GroupOptions): Group;

Parameters

Parameter

Type

Description

opts

GroupOptions

(Optional) Optional configuration for creating a group

Returns:

Group

The newly created group

Example

// Create a group containing two shapes
const group = layer.createGroup({ shapes: [shape1, shape2] });

// Create an empty group
const emptyGroup = layer.createGroup();
Last updated: October 8, 2026 at 10:45 AMEdit this page