Skip to content

Gradient

widgetsdisplay

Gradient: text rendered with a smooth color gradient

Installation

$ bunx termuijs add gradient

Copies the source into src/components/gradient/ and installs @termuijs/core, @termuijs/widgets.

Usage

ts
import { Gradient } from '@termuijs/widgets'
ts
new Gradient(text: string, style: Partial<Style> = {}, opts: GradientOptions = {})

API Reference

Gradient

PropTypeRequiredDescription
textstringrequired
startColorstringoptionalStart color (hex string like '#ff0000' or named color string)
endColorstringoptionalEnd color (hex string like '#0000ff' or named color string)
align'left' | 'center' | 'right'optionalText alignment
#display#gradient