Skip to main content

Linear Gradients Interface

linear gradient attributes can be passed via style prop to the Block component.

Prop NameTypeDescription
colors(string | number)[]Array of color values (hex strings or numbers) to define the gradient colors.
start{ x: number; y: number }Optional starting point of the gradient, where x and y are coordinates (0 to 1).
end{ x: number; y: number }Optional ending point of the gradient, where x and y are coordinates (0 to 1).
locationsnumber[]Optional array defining the position of each color in colors, as a number between 0 and 1.
useAnglebooleanOptional flag to use a specified angle for the gradient direction, if true.
angleCenter{ x: number; y: number }Optional center point for the gradient's angle, where x and y are coordinates (0 to 1).
anglenumberOptional angle, in degrees, used when useAngle is true to set the gradient's direction.