$ Animated Text
animatedasync
Four text animation effects: typewriter, gradient wave, shimmer/sparkle, and bouncing text with trail effects.
# Preview
animated text demo
Typewriter:
Hello! I'm typ▌
Hello! I'm typing this cha▌
Hello! I'm typing this character by character...
Gradient Wave:
★ Rainbow colors flowing ★
Shimmer:
S✦arkl✧ng magical ⋆ext eff✦ct
Bouncing:
>>> BOUNCE <<<
>>> BOUNCE <<<
>>> BOUNCE <<<
# Usage
example.ts
import { typewriter, gradientWave, shimmer, bouncingText } from "@vr_patel/tui";
// Typewriter — characters appear one by one
await typewriter({ text: "Hello, world!", speed: 40, color: fg.brightGreen });
// Gradient wave — rainbow colors flow through text
await gradientWave({ text: "Rainbow text!", duration: 3000 });
// Shimmer — sparkle effect across text
await shimmer({ text: "Sparkle!", duration: 3000 });
// Bouncing text — text bounces side to side with trail
await bouncingText({ text: "BOUNCE", duration: 4000 });# API
| Prop | Type | Default | Description |
|---|---|---|---|
| text | string | required | Text to animate |
| speed | number | 30-80ms | Animation frame interval |
| duration | number | 3000-4000ms | Total animation duration |
| color | string | varies | Text color (typewriter only) |
| colors | [r,g,b][] | rainbow | Gradient colors (wave only) |
| cursor | string | "▌" | Cursor character (typewriter only) |