motion-scramble
Scrambles text with random characters then progressively reveals the real text from left to right. Trigger on scroll or on hover.
Preview
Import
import 'motion-components/motion-scramble' // just this one
import 'motion-components' // or the whole libraryUsage
<motion-scramble trigger="hover">
Hover to scramble
</motion-scramble>Loop
Add loop to decode the text, hold, then scramble it again. hold sets how long the
resolved text stays readable, gap how long it rests before the next decode.
Status:
<motion-scramble interval="0.04" loop hold="1.6" gap="0.6">SYSTEM_ONLINE</motion-scramble>
With once is ignored. Add pause-on-hover to freeze it while the pointer is over the text.
Properties
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
| | | number | 0.04 | Time between scramble frames, in seconds |
| | | number | 0 | Delay before starting, in seconds |
| | | number | 2 | Scramble frames per character before revealing |
| | | string | 'view' | What starts the scramble: |
| | | boolean | true | Animate only on first intersection. Set |
| | | boolean | false | Decode, hold, then scramble again on repeat. With |
| | | number | 1.6 | With |
| | | number | 0.5 | With |
| | | boolean | false | Pause the loop while the pointer is over the text, resuming on leave |
JavaScript API
Trigger the scramble programmatically with play() and cancel().
Accessibility
Respects prefers-reduced-motion: when enabled, the scramble effect is skipped, the text appears at its final state immediately and loop never starts.