Spectrum Text

Inline text with a shifting multi-stop gradient fill from kit color tokens. Glyphs stay still; only the clipped background moves. Configurable colors and speed.

Installation

Install with the CLI, or copy the component source into your project.

Add spectrum-text (npm)

npx --yes -p github:itsvigneshv/default-file-ui#main df-ui add spectrum-text

Default

Default kit spectrum: rose-470, violet-670, blue-530, azure-330. Text stays still.

Ship beautiful

Custom colors

Neutral ink ramp from kit tokens. CSS variables paint via a CSS gradient fallback.

Ink spectrum

Speed

speed multiplies the base 10s loop. Higher values run faster.

Slow

Default

Fast

Default spectrum

Exported stops: var(--spectrum-text-color-1), var(--spectrum-text-color-2), var(--spectrum-text-color-3), var(--spectrum-text-color-4).

SpectrumText

Properties

Inline text with a shifting multi-stop gradient fill built from SVG gradient code (data URI, not an external file). Glyphs stay still; only the clipped background moves. Screen readers get a plain copy; the animated layer is aria-hidden.

SpectrumText

PropTypeDefaultNotes
childrenReactNode-Text or inline content to paint with the gradient fill.
colorsstring[]DEFAULT_SPECTRUM_COLORSGradient stops for the fill. Rendered as inline SVG linearGradient markup when colors are hex or rgb. CSS variables fall back to a CSS gradient. The first color is appended again so the loop stays seamless.
speednumber1Animation speed multiplier. 1 is the base loop (10s). 2 runs twice as fast (5s).
classNamestring-Additional styles on the host span.

Tokens

Theme defaults live on :root. Override these globally or on a local host.

TokenTypeDefaultNotes
--spectrum-text-color-1CSS colorvar(--df-rose-470)First stop. Closest kit match to magenta: rose-470.
--spectrum-text-color-2CSS colorvar(--df-violet-670)Second stop. Closest kit match to violet: violet-670.
--spectrum-text-color-3CSS colorvar(--df-blue-530)Third stop. Closest kit match to blue: blue-530.
--spectrum-text-color-4CSS colorvar(--df-azure-330)Fourth stop. Closest kit match to sky: azure-330.
--spectrum-text-durationtime10sBase loop duration at speed 1. The component overrides this from the speed prop.
--spectrum-text-easeeasingease-in-outTiming function for the spectrum loop.
--spectrum-text-background-sizebackground-size200% autoGradient size so position shifts read clearly.