rect() and xywh()Baseline · Widely available
The rect() CSS function creates a rectangle shape with insets from the edges of an element. The xywh() CSS function creates a rectangle shifted by an x and y distance. They can be used with clip-path and shape-outside.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 23, 2024. Widely available since Jul 23, 2026.
Browser support
DesktopChrome
1–118Not supported
119+Supportedsince Oct 31, 2023
Current: 155Edge
12–118Not supported
119+Supportedsince Nov 2, 2023
Current: 154Firefox
1–121Not supported
122+Supportedsince Jan 23, 2024
Current: 157Safari
1–17.1Not supported
17.2+Supportedsince Dec 11, 2023
Current: 27MobileChrome Android
18–118Not supported
119+Supportedsince Oct 31, 2023
Current: 155Firefox Android
4–121Not supported
122+Supportedsince Jan 23, 2024
Current: 157Safari iOS
1–17.1Not supported
17.2+Supportedsince Dec 11, 2023
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: rect.
Feature detection
There’s no simple runtime check for this feature; rely on the support table and test in your target browsers.
Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| <basic-shape>.rect | 119 | 119 | 122 | 17.2 | 119 | 122 | 17.2 |
| <basic-shape>.xywh | 119 | 119 | 122 | 17.2 | 119 | 122 | 17.2 |