Skip to main content

Rectangle

A rectangle with a label.

SVG selectors

Supported attrs properties:

SelectorNodeDescription
rootSVGGElementContainer of all nodes
bodySVGRectElementRectangular body of the shape
labelSVGTextElementText inside the body
const rectangle = new shapes.standard.Rectangle();
rectangle.resize(100, 100);
rectangle.position(50, 10);
rectangle.attr('root/title', 'shapes.standard.Rectangle');
rectangle.attr('label/text', 'Rectangle');
rectangle.attr('body/fill', 'lightblue');

Stay in the know

Be where thousands of diagramming enthusiasts meet

Star us on GitHub