This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The SVGGradient interface is a base interface used by SVGLinearGradientElement and SVGRadialGradientElement.
This interface also inherits properties from its parent, SVGElement.
SVGGradientElement.href Read only
An SVGAnimatedString corresponding to the href or xlink:href attribute of the given element.
SVGGradientElement.gradientUnits Read only
An SVGAnimatedEnumeration corresponding to the gradientUnits attribute on the given element. This property takes one of the constants defined in SVGUnitTypes.
SVGGradientElement.gradientTransform Read only
An SVGAnimatedTransformList corresponding to the gradientTransform attribute on the given element.
SVGGradientElement.spreadMethod Read only
An SVGAnimatedEnumeration corresponding to the spreadMethod attribute on the given element. One of the spread method types defined on this interface.
This interface does not provide any specific methods, but implements those of its parent, SVGElement.
SVG_SPREADMETHOD_UNKNOWN (0)The type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
SVG_SPREADMETHOD_PAD (1)Corresponds to value pad.
SVG_SPREADMETHOD_REFLECT (2)Corresponds to value reflect.
SVG_SPREADMETHOD_REPEAT (3)Corresponds to value repeat.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
SVGGradientElement |
1 | 12 | 1.5 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 3 | 1 |
gradientTransform |
1 | 12 | 1.5 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 3 | 1 |
gradientUnits |
1 | 12 | 1.5 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 3 | 1 |
href |
1 | 12 | 2 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 3 | 1 |
spreadMethod |
1 | 12 | 1.5 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 3 | 1 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SVGGradientElement