Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
"<rect>"

Creates a rectangle with the top-left corner at (x, y) and the specified width and height, optionally with rounded corners.

<rect x="10" y="50" width="280" height="200" fill="none" stroke="black" />

x,y width height

<rect x="10" y="50" width="280" height="200" rx="50" ry="40" fill="none" stroke="black" />

rx ry

Attribute Default Description
x 0 Top-left corner X coordinate.
y 0 Top-left corner Y coordinate.
width 0 Horizontal radius, along the X axis.
height 0 Vertical radius, along the Y axis.
rx auto ("auto" on rx/ry) For rounded corners, the radius of the curve along the X axis.
ry auto ("auto" on rx/ry) For rounded corners, the radius of the curve along the Y axis.