scrmbl

Scramble/decode text animation for React, Vue, Svelte, and vanilla JS.

zero dependencies · ~2.8 kB core · grapheme-safe · deterministic seeds · respects reduced motion

four tricks, one component

Hover states, live values, redaction, sequenced reveals — every card is the real library running with different options.

hover statescharset="upper"
live valuesscrambleAll={false}
$64,213.40
FAKE/USD · only changed digits animate
redactedcharset="blocks"
click to decrypt
sequenced
> boot: scrmbl v0.1.0

every charset, live

All ten built-in glyph pools, same sample, so you can compare their texture. Click any card to replay it — or pass your own string of characters as charset.

turn the knobs

Every control maps 1:1 to an option. The snippet underneath is copy-paste ready.

THE FUTURE IS UNWRITTEN

<Scramble
  order="start"
  charset="alnum"
  duration={800}
  stagger={20}
>
  {text}
</Scramble>

install

pnpm add scrmbl

same trick, four runtimes

The adapters are thin wrappers over one framework-agnostic controller — every option works identically everywhere.

import { Scramble, useScramble } from "scrmbl/react";

// Component: animates on mount and on change
<Scramble charset="upper" order="random">{title}</Scramble>

// Hook: full control
const { ref, replay } = useScramble({ charset: "hex" });
<h1 ref={ref} onMouseEnter={replay}>C0FFEE</h1>
entrypoint: scrmbl/react

the whole api

These are props in React, Vue, and Svelte, and an options object in vanilla.

optiondefaultdescription
duration800Total animation time (ms). Always honored — stagger compresses for long text.
stagger20Delay (ms) between successive characters starting to resolve.
order"start"Resolve pattern: start · end · center · edges · random.
charset"alnum"Glyph pool: a preset name or any custom string of characters.
glyphRate30Glyph swaps per second while a character is scrambling.
ignore""Characters never scrambled (whitespace never is, regardless).
scrambleAlltruefalse = only animate characters that changed between updates.
sweepfalseWave mode: characters hold their old glyph until their turn.
seedDeterministic runs: same seed + text + options → identical frames.
respectReducedMotiontrueSnap instantly when the user prefers reduced motion.
onStart / onCompleteAnimation lifecycle callbacks.