Text scramble
Resolves text from scrambled characters when its value changes.
STUDIO NOTES
text-scramble-basic-demo.tsx
Installation
The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.
npm
yarn
pnpm
bun
Glyphs
Use characters that have the same width in your font.
STUDIO NOTES
text-scramble-demo.tsx
Duration
Use a short duration for status labels.
- 0.4 seconds
- SYNCING
- 1.2 seconds
- SYNCING
text-scramble-duration-demo.tsx
API reference
- value: stringRequired
- The text to show. A change starts a scramble. The first value shows without a scramble. Screen readers get the final text at once.
- duration: number = 0.7
- Time in seconds to resolve the text. Set 0 to change the text without a scramble.
- glyphs: string
- Characters that show during the scramble. Without it, the scramble uses the letters A to Z and the digits 0 to 9. The default monospace font keeps the width the same.