Overview
Import DecryptedText from the decrypted-text entry and pass the text as a string child. It renders a span by default; set as to render a p, div, or heading. The defaults are trigger view, order start, effect scramble, speed 50 ms, iterations 10, delay 0, and appearance default, which keeps the surrounding text colour for scrambled glyphs.
The view and mount triggers start scrambled, and the first glyphs are deterministic so server and client HTML match. The hover trigger starts as plain text and also responds to keyboard focus. onComplete fires each time decoding finishes. Style letters that are still scrambled with the [data-scrambled] attribute.
Consumers using Tailwind v4 must include the package in their @source scan so both light and dark token classes are generated.
Common use cases
- Hero headlines and section labels with a technical or security theme.
- Link and button labels that decode on hover or keyboard focus.
- Status lines such as "Connection established" in dashboards and terminals.
FAQ
Do screen readers hear the random characters?
No. The real text is kept in a visually hidden copy and the animated letters are aria-hidden, so assistive tech reads the final words from the start.
Does the text jump around while it decodes?
No. Each scrambled glyph floats over its hidden real letter and is squeezed to that letter's width, so the line keeps its width throughout.
Does it need Framer Motion?
No. It runs on one requestAnimationFrame loop and writes to the letters directly. The flip effect uses the browser's Web Animations API.