Getting Started
Components
- Animated Beam
- Animated Circular Progress Bar
- Animated Gradient Text
- Animated Grid Pattern
- Animated List
- Animated Shiny Text
- Animated Theme Toggler
- Aurora Text
- Backlight New
- Avatar Circles
- Bento Grid
- Blur Fade
- Border Beam
- Cool Mode
- Dia Text Reveal New
- Dither Shader New
- Dock
- Dot Pattern
- Dotted Map New
- File Tree
- Flickering Grid
- Grid Pattern
- Hero Video Dialog
- Hyper Text
- Icon Cloud
- Interactive Hover Button
- Lens
- Light Rays
- Line Shadow Text
- Magic Card
- Marquee
- Meteors
- Morphing Text New
- Motion Grid Beta
- Neon Gradient Card
- Number Ticker
- Orbiting Circles
- Pixel Image New
- Pointer
- Progressive Blur
- Pulsating Button
- Rainbow Button
- Retro Grid
- Ripple
- Ripple Button
- Scroll Progress
- Shimmer Button
- Shine Border
- Smooth Cursor
- Striped Pattern New
- Text Animate
- Typing Animation
- Video Text
- Warp Background
- Word Rotate Beta
Dia Text Reveal
A sweeping gradient text reveal with viewport triggering and rotating text support.
motion-sv
Joy of Code
Installation
pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/r/dia-text-reveal.json
Install dependencies
Install the required packages for this component:
pnpm add motion-sv
Copy the Source Code
Copy and paste the following code into your project:
dia-text-reveal.svelte
index.ts
Folder Structure
Folder Structure
Examples
Custom Gradient
Design systems
Rotating Phrases
Learn to build faster
Duration and Delay
Made with care
Props
DiaTextReveal
A component for revealing text with a moving gradient sweep.
| Name | Type | Default | Description |
|---|---|---|---|
text | string | string[] | required | Text to reveal. Pass multiple strings to rotate when repeat is enabled. |
colors | string[] | ["#c679c4", "#fa3d1d", "#ffb005", "#e1e1fe", "#0358f7"] | Colors sampled across the moving gradient band. |
textColor | string | "var(--foreground)" | CSS color for revealed text after the sweep. |
duration | number | 1.5 | Duration of one sweep pass in seconds. |
delay | number | 0 | Delay before the sweep starts in seconds. |
repeat | boolean | false | Replay the sweep and advance to the next string after each completion. |
repeatDelay | number | 0.5 | Pause between repeated cycles in seconds. |
triggerOnView | boolean | true | Start the reveal when the component enters the viewport. |
once | boolean | true | When using triggerOnView, run only on the first viewport entry. |
fixedWidth | boolean | false | Use the widest string width instead of animating width between strings. |
class | string | "" | Additional CSS classes to apply to the animated span. |