✅ 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
| Parameter | Type | Description |
|---|---|---|
direction | LinearGradientDirection | The gradient direction |
stops | readonly GradientStop[] | The color stops |
# Returns
A linear gradient configuration
# Example
const gradient = createLinearGradient(
GradientDirections.topToBottom,
[
{ position: 0, color: '#003399' },
{ position: 1, color: '#3366AA' }
]
);