A gradient sweep that reveals text with a chromatic wash, powered by Motion.
Made by AxylInstallation
File Structure
Usage
Loop the wash:
Custom palette:
Cycle through multiple words (requires repeat):
Right-to-left sweep, custom color, and a completion callback:
Render as a different element and control it imperatively:
Props
| Prop | Type | Default |
|---|---|---|
text? | string | string[] | - |
colors? | string[] | ["#f0abfc", "#f472b6", "#fb923c", "#facc15", "#a3e635"] |
duration? | number | 1.5 |
delay? | number | 0 |
direction? | "ltr" | "rtl" | "ltr" |
ease? | string | number[] | ((t: number) => number) | [0.23, 1, 0.32, 1] |
fadeEase? | string | number[] | ((t: number) => number) | "easeInOut" |
textColor? | string | "currentColor" |
as? | React.ElementType | "span" |
onComplete? | () => void | - |
ref? | Ref<DiaTextRevealHandle> | - |
repeat? | boolean | false |
repeatDelay? | number | 0.5 |
holdDuration? | number | 1 |
fadeDuration? | number | 0.6 |
fixedWidth? | boolean | false |
startOnView? | boolean | true |
once? | boolean | true |
inViewMargin? | string | "0px" |
className? | string | - |
Accessibility
The revealed string is always in the DOM — the gradient sweep and opacity fade are visual only. Screen readers announce the current phrase as plain text.
When prefers-reduced-motion: reduce is set, useReducedMotion() skips the sweep, fade, and phrase rotation entirely: the first string in text renders fully visible at the final gradient position (background-position: 0%, opacity: 1). Imperative play() / replay() become no-ops. No extra configuration needed.
If you cycle phrases with repeat and an array, only the first phrase is shown under reduced motion — prefer a single string (or put the most important phrase first) when that static fallback matters for meaning.
Credits
Inspired by Dia Text. Reimplemented for Motion and React.
This is a from-scratch rebuild of the idea, not a port: the gradient-wash reveal and multi-phrase cycling are reimplemented in React with motion/react (motion values, useTransform, imperative animate() sequencing), and extended with a repeat fade-hold-reset cycle, direction, textColor, ease/fadeEase, polymorphic as, and an imperative play/replay control ref.
Built by Axyl. A motion-first component registry for React.
Last updated: 7/10/2026