Methods
Fills the rectangle interior with a color, gradient, or other style.
Draws the rectangle outline. Pass a Style for a 1-point stroke, or a StrokeOptions object (
{ style: Style, lineWidth?: number }) for custom width.Support
Usage
Basic rectangle
Stroked rectangle
As a background
Color swatch
Notes
- For rounded corners, use RoundedRectangle or the
.cornerRadius()modifier.
See Also
- RoundedRectangle — rectangle with rounded corners
- Circle — circle shape
- Capsule — capsule shape