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

text animations

Encrypted Text

Characters scramble through random glyphs and progressively resolve to the real text — a military terminal-style decrypt effect. Supports four reveal directions.

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 start it later, for example when it scrolls into view.
  • revealDirection is "ltr", "rtl", "center" or "random". speed and maxIterations control how long it takes.
  • Screen readers get the final text through aria-label; the changing characters are hidden from them.
  • When the user has turned on reduced motion, the text shows straight away with no cipher characters; onComplete still fires.

Props

Examples

Hero Headline

Large heading decrypts left-to-right on mount with a fast speed and high maxIterations for a dramatic reveal.

Terminal Session

CLI commands decrypt sequentially as the user presses "Enter", simulating a live terminal session. Each command is a separate EncryptedText instance.

Direction Picker

Buttons trigger a replay with each of the four revealDirection values — ltr, rtl, center, random — to compare the effects side by side.