Wrap a heading, or the label of a link or a button with trigger="hover".
studio-nav.tsx
TextScramble
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| locale | string | — | The BCP 47 locale for the letter and word split (Intl.Segmenter). Default: the DisplayLocaleProvider locale, else "en-US". |
| children | string | — | 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. |
| duration | number | — | Seconds from start to the last letter in place. Default: 40ms a letter, 0.5s to 1.2s. |
| characters | string | — | 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. |
| on | — | Called when the last letter is in place. | |
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
| Tab | With trigger="hover", keyboard focus on the link or button around the text starts the scramble. |
|---|



