Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Text Scramble

Pro

Decodes text from random glyphs on mount, hover or focus.

Installation

pnpm dlx shadcn@latest add @viewport/text-scramble

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
text*string—
charactersstring

Characters used while scrambling.

DEFAULT_CHARS
speednumber

Milliseconds between frames.

28
trigger"mount" | "hover" | "both"

When to play: on mount, on hover/focus, or both.

"both"
classNamestring—

Accessibility

  • The real text is always available to screen readers.
  • Replays on keyboard focus as well as hover.
  • Shows the final text immediately under reduced motion.