sisense.com
✅ You are viewing documentation for the latest version of Compose SDK.
Version:

Function createLinearGradient

createLinearGradient(direction, stops): LinearGradientColor

Helper function to create a linear gradient with common direction presets.

Parameters

ParameterTypeDescription
directionLinearGradientDirectionThe gradient direction
stopsreadonly GradientStop[]The color stops

Returns

LinearGradientColor

A linear gradient configuration

Example

const gradient = createLinearGradient(
  GradientDirections.topToBottom,
  [
    { position: 0, color: '#003399' },
    { position: 1, color: '#3366AA' }
  ]
);
Last Updated: