Skip to content

GradientValue

A gradient fill value. Accepted by color properties (backgroundColor, fillColor, strokes, textColor) as an alternative to a solid color string or token reference.

type GradientValue = LinearGradient | RadialGradient | AngularGradient;

DIAMOND gradients are intentionally excluded — they have no native CSS, SwiftUI, or Compose equivalent.

Properties

All three gradient types share the same base properties, with LinearGradient using angle and the others using center.

LinearGradient

PropertyTypeRequiredDescription
type'LINEAR'Yes
anglenumberYesGradient angle in degrees
stopsGradientStop[]YesColor stops
type: LINEAR
angle: 180
stops:
- position: 0
color: "#FFFFFFFF"
- position: 1
color:
$token: DS Color.Surface.Muted
$type: color

RadialGradient

PropertyTypeRequiredDescription
type'RADIAL'Yes
centerGradientCenterYesCenter point
stopsGradientStop[]YesColor stops
type: RADIAL
center:
x: 0.5
y: 0.5
stops:
- position: 0
color: "#FFFFFFFF"
- position: 1
color: "#00000000"

AngularGradient

PropertyTypeRequiredDescription
type'ANGULAR'Yes
centerGradientCenterYesCenter point
stopsGradientStop[]YesColor stops
type: ANGULAR
center:
x: 0.5
y: 0.5
stops:
- position: 0
color: "#FF0000FF"
- position: 0.33
color: "#00FF00FF"
- position: 0.66
color: "#0000FFFF"
- position: 1
color: "#FF0000FF"

Values

NameDescriptionExample
GradientStopA color at a position along the gradient{ position: 0.5, color: "#FF0000FF" }
GradientCenterRelative center point (0–1 range){ x: 0.5, y: 0.5 }

GradientStop

PropertyTypeDescription
positionnumberPosition along the gradient vector (0–1)
colorstring | TokenReferenceHex color (#RRGGBBAA) or token reference

GradientCenter

PropertyTypeDescription
xnumberHorizontal position relative to the fill bounding box (0–1)
ynumberVertical position relative to the fill bounding box (0–1)

Further Reading