IGradient

interface
Color & Intent

Structured gradient descriptor — one of the three accepted formats for color/bgColor/textColor props. Supports linear, radial and conic types; short form (from/to/via) or full form (stops array).

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

type
'linear' | 'radial' | 'conic'
Gradient type. Defaults to "linear".
from
TIntent | string
Start color of the short-form 2–3 stop gradient. A TIntent alias or raw CSS color.
to
TIntent | string
End color of the short-form gradient.
via
TIntent | string
Optional middle color of the short-form gradient, auto-positioned at 50%.
direction
number | string
Angle in degrees (default 135) or a CSS keyword such as "to right" / "to bottom left". For radial/conic, used as the shape/position prefix (e.g. "circle at center").
stops
IGradientStop[]
Full-form stop list — overrides from/to/via entirely when provided. Each entry is an IGradientStop with a color and a percentage position.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Short form — from / to

html

Full form — explicit stops

typescript