Dia Text
Animated inline text reveal with a sweeping gradient band, repeat controls, and optional fixed-width rotation for motion-driven typography.
Make interfaces feel
Installation
npx shadcn@latest add @iconiq/dia-textProps
DiaTextReveal
11 props
Animated inline text reveal that sweeps a multicolor gradient band across one string or rotates through multiple strings while preserving the same baseline flow.
text
string | string[]Required
Single string to reveal, or an array of strings to cycle through. When you pass multiple entries, the component tracks an active index and can animate width between them.
colors
string[]Gradient stops used for the sweep band. If omitted, the component uses its built-in five-color palette.
textColor
stringDefault
"var(--foreground)"Base text color used before and after the animated color band passes across the text.
duration
numberDefault
1.5Duration of the sweep animation in seconds for each reveal cycle.
delay
numberDefault
0Delay in seconds before the reveal animation begins.
repeat
booleanDefault
falseWhen true, the component keeps replaying the sweep and advances through the text array if multiple entries are provided.
repeatDelay
numberDefault
0.5Pause in seconds between repeated reveal cycles.
triggerOnView
booleanDefault
trueToggles viewport-based playback. When true, the reveal waits until the span enters view before it starts.
once
booleanDefault
trueControls whether in-view playback should only happen once or be allowed to replay when the element re-enters view.
fixedWidth
booleanDefault
falseWhen rotating multiple text entries, fixes the rendered width to the widest measured string instead of animating width between each item.
className
stringMerged onto the rendered motion span for local typography or layout overrides.
Notes
The component forwards the remaining Motion span props, so aria attributes, inline data attributes, and other span-level props can still be applied at the call site.
Children are not part of the public API surface here; the rendered content always comes from the text prop.