Rectangle
Draw rectangles with optional rounded corners
Rectangle
Draw rectangles with optional rounded corners
Overview
The Rectangle node draws a rectangle on a transparent canvas. Create filled or outlined rectangles with optional rounded corners for buttons, frames, and UI elements.
Usage Tips
- Use corner_radius for rounded rectangles (0 = sharp corners)
- Set stroke_width > 0 and fill = false for outlined rectangles
- Output image size matches the specified dimensions exactly
- Great for creating buttons, cards, and frame overlays
Common Pairings
- Merge - Add rectangular frames or backgrounds to images
- Text - Layer text on rectangular buttons
- Composite - Build UI mockups with multiple rectangles
Gotchas
- Corner radius can’t exceed half the smaller dimension
- Stroke extends inward from rectangle edges
- For complex shapes, consider using multiple rectangles with Composite
Technical Reference
Outputs
| Name | Type | Description |
|---|---|---|
output | Image | Rendered rectangle image |
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
params_size | size | map[height:300 width:400] | Rectangle dimensions (width, height) |
params_colour | color | #0000FF | Fill or stroke color |
params_stroke_width | number | 0 | Stroke width (0 for filled) |
params_fill | boolean | true | Fill the rectangle (true) or just outline (false) |
params_corner_radius | number | 0 | Corner radius for rounded rectangles |