Sora UI

Text Scramble

A text scramble reveal animation that decodes characters on mount or when re-triggered, powered by Motion. React.

Made by Axyl
Loading...

Text scramble reveal that decodes characters on mount — refresh or use the trigger prop to replay.

Installation

npx shadcn@latest add @soralabs/text-scramble

File Structure

text-scramble.tsx

Usage

Re-run the animation by toggling trigger:

Run on hover instead of on mount (trigger is ignored automatically):

Color sweep while decoding — scramble noise in one color, revealed letters keep your text color:

holdDuration scrambles in place first; then the reveal sweeps left to right.

Props

PropTypeDefault
children?
string
-
as?
ElementType
"p"
scrambleColor?
string
-
holdDuration?
number
0
duration?
number
0.8
speed?
number
0.04
characterSet?
string
-
trigger?
boolean
true
triggerOnHover?
boolean
false
className?
string
-
onScrambleComplete?
() => void
-

When to Use

Use TextScramble for hero headings, data dashboards revealing a new value, or any reveal moment where the text should feel like it is being decoded. It pairs well with monospace or uppercase fonts where individual character changes are visually clear.

The triggerOnHover mode works well for navigation labels and interactive buttons that reward hovering.

Accessibility

The final decoded text is always in the DOM — the scramble is a visual effect applied character by character. Screen readers announce the final string. When prefers-reduced-motion: reduce is set, the component already skips the scramble automatically (via useReducedMotion()) and renders the final text directly — no extra configuration needed.

Built by Axyl. A motion-first component registry for React.

Last updated: 9/14/2026

On this page

Help keep SoraLabs moving.

Every contribution helps us build and maintain open-source tools for the community.

Sponsor on GitHub