Components · 2 min read
ScrambleText
Text scramble animation component for creating decode effects
ScrambleText
The ScrambleText component creates a text scramble/decode animation effect when the text content changes.
Basic Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
text* | string | - | The text to display and animate |
duration | number | 300 | Total animation duration in milliseconds |
interval | number | 50 | Interval between character updates |
chars | string | 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' | Characters to use for scrambling |
animate | boolean | true | Whether to animate text changes |
onComplete | () => void | - | Callback fired when animation completes |
Examples
Custom Scramble Characters
Controlled Animation
With Callback
Disable Animation
Styling
ScrambleText accepts standard HTML attributes and can be styled with className or style: