This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
* Some parts of this feature may have varying levels of support.
The <radialGradient> SVG element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
Note: Don't be confused with CSS radial-gradient() as CSS gradients can only apply to HTML elements where SVG gradient can only apply to SVG elements.
| Categories | Gradient element |
|---|---|
| Permitted content | Any number of the following elements, in any order: Descriptive elements <animate>, <animateTransform>, <discard>, <script>, <set>, <stop>, <style>
|
cxThis attribute defines the x coordinate of the end circle of the radial gradient. Value type: <length>; Default value: 50%; Animatable: yes
cyThis attribute defines the y coordinate of the end circle of the radial gradient. Value type: <length>; Default value: 50%; Animatable: yes
frThis attribute defines the radius of the start circle of the radial gradient. The gradient will be drawn such that the 0% <stop> is mapped to the perimeter of the start circle. Value type: <length>; Default value: 0%; Animatable: yes
fxThis attribute defines the x coordinate of the start circle of the radial gradient. Value type: <length>; Default value: Same as cx; Animatable: yes
fyThis attribute defines the y coordinate of the start circle of the radial gradient. Value type: <length>; Default value: Same as cy; Animatable: yes
gradientUnitsThis attribute defines the coordinate system for attributes cx, cy, r, fx, fy, fr Value type: userSpaceOnUse | objectBoundingBox; Default value: objectBoundingBox; Animatable: yes
gradientTransformThis attribute provides additional transformation to the gradient coordinate system. Value type: <transform-list>; Default value: identity transform; Animatable: yes
hrefThis attribute defines a reference to another <radialGradient> element that will be used as a template. Value type: <URL>; Default value: none; Animatable: yes
rThis attribute defines the radius of the end circle of the radial gradient. The gradient will be drawn such that the 100% <stop> is mapped to the perimeter of the end circle. Value type: <length>; Default value: 50%; Animatable: yes
spreadMethodThis attribute indicates how the gradient behaves if it starts or ends inside the bounds of the shape containing the gradient. Value type: pad | reflect | repeat; Default value: pad; Animatable: yes
xlink:href Deprecated
An <IRI> reference to another <radialGradient> element that will be used as a template. Value type: <IRI>; Default value: none; Animatable: yes
This element implements the SVGRadialGradientElement interface.
<svg
viewBox="0 0 10 10"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<radialGradient id="myGradient">
<stop offset="10%" stop-color="gold" />
<stop offset="95%" stop-color="red" />
</radialGradient>
</defs>
<!-- using my radial gradient -->
<circle cx="5" cy="5" r="4" fill="url('#myGradient')" />
</svg>
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
radialGradient |
1 | 12 | 1.5 | 9 | 3 | 18 | 4 | 10.1 | 2 | 1.0 | 3 | 2 |
cx |
1 | 79 | 1.5 | 15 | 3 | 18 | 4 | 14 | 2 | 1.0 | 4.4 | 2 |
cy |
1 | 79 | 1.5 | 15 | 3 | 18 | 4 | 14 | 2 | 1.0 | 4.4 | 2 |
fr |
24 | 79 | 55 | 15 | 7 | 25 | 55 | 14 | 7 | 1.5 | 4.4 | 7 |
fx |
1 | 79 | 1.5 | 15 | 3 | 18 | 4 | 14 | 2 | 1.0 | 4.4 | 2 |
fy |
1 | 79 | 1.5 | 15 | 3 | 18 | 4 | 14 | 2 | 1.0 | 4.4 | 2 |
gradientTransform |
1 | 79 | 1.5 | 15 | 3 | 18 | 4 | 14 | 2 | 1.0 | 4.4 | 2 |
gradientUnits |
1 | 79 | 1.5 | 15 | 3 | 18 | 4 | 14 | 2 | 1.0 | 4.4 | 2 |
href |
50 | 12 | 51 | 37 | 12.1 | 50 | 51 | 37 | 12.2 | 5.0 | 50 | 12.2 |
r |
1 | 79 | 1.5 | 15 | 3 | 18 | 4 | 14 | 2 | 1.0 | 4.4 | 2 |
spreadMethod |
1 | 79 | 1.5 | 15 | 3 | 18 | 4 | 14 | 2 | 1.0 | 4.4 | 2 |
xlink_href |
1 | 79 | 1.5 | 15 | 3 | 18 | 4 | 14 | 2 | 1.0 | 4.4 | 2 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/radialGradient