files/en-us/web/svg/reference/element/rect/index.md
The <rect> SVG element is a basic SVG shape that draws rectangles, defined by their position, width, and height. The rectangles may have their corners rounded.
{{svginfo}}
0; Animatable: yes0; Animatable: yesauto | <length> | <percentage>; Default value: auto; Animatable: yesauto | <length> | <percentage>; Default value: auto; Animatable: yesry if it is specified.
Value type: auto | <length> | <percentage>; Default value: auto; Animatable: yesrx if it is specified.
Value type: auto | <length> | <percentage>; Default value: auto; Animatable: yes[!NOTE] Starting with SVG2,
x,y,width,height,rxandryare Geometry Properties, meaning those attributes can also be used as CSS properties for that element.
This element implements the {{domxref("SVGRectElement")}} interface.
html,
body,
svg {
height: 100%;
}
<svg viewBox="0 0 220 100" xmlns="http://www.w3.org/2000/svg">
<!-- Regular rectangle -->
<rect width="100" height="100" />
<!-- Rounded corner rectangle -->
<rect x="120" width="100" height="100" rx="15" />
</svg>
{{EmbedLiveSample('Example', 100, '100%')}}
{{Specifications}}
{{Compat}}