Rect

The  element is a basic SVG shape that draws rectangles, based on their position, width, and height. The rectangles can have their corners rounded.

Example

 &lt;svg viewBox="0 0 220 100" xmlns="http://www.w3.org/2000/svg"&gt; &lt;!-- Simple rectangle --&gt; &lt;rect width="100" height="100" /&gt;

&lt;!-- Rounded corner rectangle --&gt; &lt;rect x="120" width="100" height="100" rx="15" /&gt; &lt;/svg&gt;

Result

Attributes



  The x coordinate of the rect.

  The y coordinate of the rect.

  The width of the rect.

  The height of the rect.</dd>

 </dt> The horizontal corner radius of the rect. Defaults to  if it is specified.</dd>

 </dt> The vertical corner radius of the rect. Defaults to  if it is specified.</dd>

 </dt> The total length of the rectangle's perimeter, in user units.</dd>

</dl>

References