Reveals text with a randomized character scramble/glitch effect. Perfect for status messages, dynamic content, or adding visual interest to text transitions.
Made by LéoOverview
The Scramble Text component animates text by revealing characters one by one, with unrevealed characters displaying random glitches. It's ideal for loading states, status updates, code snippets, or any moment where you want text to have impact.
Installation
Usage
Basic
Custom styling
Manual control
Auto-cycling through phrases
Props
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | — | The final text to reveal. |
scrambleSpeed | number | 50 | Interval in ms between each animation tick. |
scrambledLetterCount | number | 2 | Number of scrambled characters shown ahead of revealed text. |
characters | string | "abcdefghijklmnopqrstuvwxyz!@#…" | Pool of characters used for the scramble effect. |
className | string | — | Class applied to the revealed portion of text. |
scrambledClassName | string | — | Class applied to the scrambled (unrevealed) portion of text. |
autoStart | boolean | true | Whether to start the animation automatically on mount. |
delay | number | 0 | Delay in ms before autoStart fires. |
onStart | () => void | — | Callback fired when the animation begins. |
onComplete | () => void | — | Callback fired when the animation completes. |
Methods
| Method | Description |
|---|---|
start() | Starts (or restarts) the scramble animation. |
reset() | Stops the animation and clears the text. |