Installation
npx shadcn@latest add @iconiq/dia-textProps
DiaTextReveal
Animated inline text reveal that sweeps a multicolor gradient band across one string or rotates through multiple strings while preserving the same baseline flow.
textstring | string[]Required
colorsstring[]textColorstringDefault "var(--foreground)"
durationnumberDefault 1.5
delaynumberDefault 0
repeatbooleanDefault false
repeatDelaynumberDefault 0.5
triggerOnViewbooleanDefault true
oncebooleanDefault true
fixedWidthbooleanDefault false
classNamestringThe 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.
Motion and width behavior
The reveal is driven by a motion value that builds a gradient band in real time, then optionally replays and rotates through measured text entries.
When multiple text values are provided, the component clones the span to measure each string and can animate the width between entries for a smoother swap.
If triggerOnView is enabled, playback is gated by the local viewport observer instead of always running on mount.
Registry bundle
Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.
Dependencies: motion.