Skip to content
Textlab
1
Browse

ComponentsTyping

Scramble text

Letters decode into place.

Access granted

Installation

$ npx shadcn@latest add @textlab/scramble-text

Needs @textlab in your components.json. Setup takes a minute.

Usage

usage.tsx
import { ScrambleText } from "@/components/textlab/scramble-text/scramble-text";

<ScrambleText text="Access granted" variant="symbols" />

Variants

randomsymbolsbinary

Props

PropTypeDefaultDescription
text*string–The copy.
variant"random" | "symbols" | "binary""random"Which glyphs flicker before each letter settles.
charsetstring–Custom glyphs; overrides the variant.
asElementType"span"Rendered element.
trigger"mount" | "inView" | "hover" | "manual""inView"What starts the animation. manual follows `active`.
activebooleanfalseDrives trigger="manual".
oncebooleantrueIn view: play once instead of on every entry.
delaynumber0Seconds before the first part moves.
durationnumber1.2Seconds each part takes.
ticknumber45Milliseconds between glyph changes.
reducedMotion"user" | "always" | "never""user"user follows the OS setting; always shows the still version.
classNamestring–Merged onto the root.
onComplete() => void–Called when a one-shot animation finishes.

When to use it

Reach for it

  • Tech, security and launch moments.
  • Short labels that should feel computed.

Skip it

  • Body copy.
  • Anything that must be read during the first second.

Accessibility and motion

Accessibility

  • Screen readers only ever hear the real text.
  • The real text reserves layout, so lines never jump.

Motion

  • Settles left to right with a short lead, so the end of the word stays alive longest.
  • Whitespace never scrambles, keeping word shapes.
Reduced motion. Shows the real text, no glyphs.

Performance

  • One rAF loop while running; idle after it settles.
  • Glyphs change every 45 ms, not every frame.