Shapes
Scripting provides a suite of shape components for creating scalable, vector-based UI elements such as rectangles, circles, capsules, ellipses, and rounded rectangles. These shapes support customizable fill, stroke, trimming, and sizing, making them ideal for dashboards, decorative elements, and interactive visuals.
Common ShapeProps
All shape components support the following properties for visual customization:
Property Descriptions
StrokeStyle
To define the appearance of a shape’s stroke, you can use the strokeStyle object:
StrokeStyle Options
Supported Shape Components
Rectangle
A basic rectangle.
RoundedRectangle
A rectangle with uniformly or dimensionally rounded corners.
UnevenRoundedRectangle
A rectangle with individually configurable corner radii.
Circle
A circle centered within its frame.
Capsule
An elongated shape with fully rounded ends.
Ellipse
An oval shape fitted inside a rectangular frame.
Notes
- To apply advanced stroke customization (e.g. dashed outlines), use the
strokeStyleobject. - The
strokeLineWidthproperty is deprecated and should be replaced withstroke.strokeStyle.lineWidth. - The
trimmodifier is particularly useful for animations (e.g., animated drawing of progress rings). - All shapes are compatible with layout modifiers like
frame,padding, andbackground.
