Skip to main content

Rectangles

A rectangle is a kind of Shape.

A Shape can be used to build rectangles, circles, paths, and more.

Below, we create a Shape that is a solid purple rectangle with a size of height: 80 and width: 120 and position it in the upper left of the screen. The center of this rectangle will be at { x: 80, y: 90 }.

Loading...
Explore:
  • Add an outline to the shape by specifying its strokeColor and lineWidth.
  • Make an empty shape by setting fillColor to WebColors.Transparent.
  • Add rounded corners with the cornerRadius property.