Skip to content

Text Scramble

Free

The letters change to random characters, then settle one by one into the real text, like a decoder.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 14, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Wrap a heading, or the label of a link or a button with trigger="hover".

studio-nav.tsx

TextScramble

<span>
PropTypeDefaultDescription
localestring—The BCP 47 locale for the letter and word split (Intl.Segmenter). Default: the DisplayLocaleProvider locale, else "en-US".
childrenRequiredstring—The text. A new text scrambles into place again.
trigger"hover""mount""view""view"When the scramble runs: view (default) the first time it is on screen, mount at once, or hover each time the pointer enters it or keyboard focus reaches it. With hover inside a link or a button, that control starts it. With view and mount the text is scrambled from the first paint (the server HTML too) until its run decodes it; with hover it is the real text until the pointer comes.
durationnumber—Seconds from start to the last letter in place. Default: 40ms a letter, 0.5s to 1.2s.
charactersstring—The letters to scramble with. Default: a random letter of the same kind and about the same width (a narrow small letter becomes another narrow one; a digit becomes a digit), and the letters of the text itself for scripts other than Latin, so a word keeps about its width.
order"center""edges""end""random""start""start"The order in which the letters settle: start (default, reading order), end, center (from the middle out), edges (from both ends in), or random (a fixed shuffle of each text).
punctuation"keep""scramble""keep"What happens to marks that are not letters or digits ("$", ",", "•"): keep (default) leaves them in place, scramble changes them with the letters, so a row of dots can scramble from digits or back.
onComplete—Called when the last letter is in place.
...props<span> attributes—Every other attribute goes to the <span>, with a ref.
  • Use trigger="hover" inside a link or a button: the control starts it on hover and on keyboard focus.
  • Use a monospace font when the text must not shake: every letter has one width.
  • Use characters for your own set ("01", block marks); the default keeps each letter's kind and about its width.
  • Change the text to scramble the new one into place (a status that moves to the next step).
TabWith trigger="hover", keyboard focus on the link or button around the text starts the scramble.
Scramble
progress · 40ms a letter, 0.5s to 1.2s · linear · every letter changes 20 times a second for the first quarter, then the letters settle in `order`
Restart
progress · a new hover in the middle of a run starts it again from the top
  1. AddedText Scramble.
Open the release