Props
Visual Properties
Fill color as RGBA tuple
[R, G, B, A], where each component ranges from 0-255.Example: [255, 0, 0, 255] for opaque redStroke (outline) color as RGBA tuple
[R, G, B, A], where each component ranges from 0-255.Example: [0, 0, 0, 255] for opaque blackWidth of the stroke in pixels.
Stroke dash pattern as an array of lengths in pixels.Example:
[5, 10] creates a 5px dash followed by 10px gapOffset for the stroke dash pattern in pixels.
Cap style for stroke endpoints. Valid values:
"square"- Square cap"round"- Rounded cap"butt"- Flat cap (default)
Join style for stroke corners. Valid values:
"miter"- Sharp corner (default)"round"- Rounded corner"bevel"- Beveled corner
Miter limit for stroke joins. Controls how sharp miter joins can be before being beveled.
Opacity value from 0 (fully transparent) to 255 (fully opaque).
Fill rule for determining the shape interior. Valid values:
"nonzero"- Non-zero winding rule (default)"evenodd"- Even-odd rule
Transform Properties
X-axis translation in pixels.
Y-axis translation in pixels.
Rotation angle in degrees.
Horizontal scale factor.
Vertical scale factor.
Usage
Basic Shape with Rectangle
Shape with Stroke
Dashed Stroke
Transformed Shape
Parent-Child Relationships
- Parent: Must be a child of Scene or SwCanvas/GlCanvas root
- Children: Must contain at least one geometry child:
TypeScript Interface
packages/fiber/src/types.ts:78-131