cnippet/ui
  1. motion
  2. text animations
  3. text scramble

text animations

Text Scramble

Characters scramble through random glyphs before resolving to the final text, creating a cipher-decoding effect on mount.

Installation

Usage

Anatomy

Good to know

  • children must be a plain string.
  • It plays as soon as it mounts. Set trigger={false} and switch it to true to replay or delay it.
  • duration and speed are in seconds. onScrambleComplete fires when the text settles.
  • Screen readers may read the scrambled characters. Add an aria-label with the final text if that matters.
  • When the user has turned on reduced motion, the text shows straight away with no scramble; onScrambleComplete still fires.

Props

Examples

Hero Headline

Auto-triggers on mount and resolves the full headline left-to-right. Increase duration for longer text.

Click to Retrigger

Manually controls the trigger prop by briefly resetting it, letting users replay the scramble on demand.

Scrambled Stats

Multiple TextScramble instances with staggered duration values create a sequential reveal across a stats row.