patternUnits
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
The patternUnits attribute indicates which coordinate system to use for the geometry properties of the <pattern> element.
You can use this attribute with the following SVG elements:
Examples
Elements
You can use this attribute with the SVG elements described in the sections below.
<pattern>
For <pattern>, patternUnits defines the coordinate system in use for the geometry properties (x, y, width and height) of the element.
| Value | userSpaceOnUse | objectBoundingBox |
|---|---|
| Default value | objectBoundingBox |
| Animatable | Yes |
userSpaceOnUse-
This value indicates that all coordinates for the geometry properties refer to the user coordinate system as defined when the pattern was applied.
objectBoundingBox-
This value indicates that all coordinates for the geometry properties represent fractions or percentages of the bounding box of the element to which the pattern is applied. A bounding box could be considered the same as if the content of the
<pattern>were bound to a"0 0 1 1"viewBox.
Specifications
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2 # PatternElementPatternUnitsAttribute |