Encrypted Text, animated React component
Text that decodes itself: every character shuffles through a charset in a fixed-width cell so the line never jitters, then a lock wave runs left to right and each character drops into place with a spring pop. Start it on load, on hover, on click or when it scrolls into view, and loop it if you like.
- Free
- Motion Effects
- Hover
- Scroll
- Spring
Like Encrypted Text? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Encrypted Text stays free.
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| text | string | — | The string that ends up on screen. |
| trigger | "load" | "hover" | "viewport" | "click" | "load" | What starts the decode. Load and viewport start scrambled. |
| speed | number | 50 | Milliseconds between one character locking and the next. |
| shuffleSpeed | number | 35 | Milliseconds between scramble ticks. |
| iterations | number | 8 | Scramble ticks before the first character locks. |
| revealDelay | number | 0 | Milliseconds before the decode starts. |
| characters | string | — | Characters used while scrambling. |
| loop | boolean | false | Scrambles and decodes again after loopDelay. |
| loopDelay | number | 2000 | Milliseconds between loops. |
| scrambleClassName | string | — | Classes for the scrambling glyphs. Defaults to the accent blue. |
| as | "span" | "p" | "h1" | "h2" | "h3" | "div" | "span" | Root element. |
| onComplete | () => void | — | Called each time every character has locked in. |
| className | string | — | Classes for the root element. It is monospaced by default; pass font-sans to change that. |
| autoplay | boolean | false | Replays the decode every loopDelay ms until someone hovers, focuses or clicks it. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry
Run this once per project. It writes the Nexus UI entry into
components.jsonfor you:npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"Type it exactly as shown.
{name}is filled in by the CLI with the component you ask for, so you never replace it.
- 3
Add the component
Run this from your project root. It adds the component, the helpers it imports and its npm packages.
npx shadcn@latest add @nexus-labs/encrypted-text
- 4
Check what was added
With a project made as in the Quick Start (a
src/folder), these files land in it:components/encrypted-text/encrypted-text.tsxindex.ts - 5
Copying by hand? Skip the registry
Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that
cn()exists. Install the packages:npm install framer-motion
Then show the source and create each file at the path it gives:
- 6
Use it in a page
Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:
// src/app/page.tsx import { EncryptedText } from "@/components/encrypted-text"; export default function Page() { return ( <main> <EncryptedText /> </main> ); }
Like Encrypted Text? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Encrypted Text stays free.
About Encrypted Text
The Encrypted Text component scrambles characters randomly before revealing the final text, cycling through alphanumeric characters at configurable speed before settling. It triggers on mount by default but can also be bound to hover or scroll events. Use it for data-like reveals, loading state placeholders where real data is incoming, or as a stylistic animation for developer-focused products that want to communicate a coded, technical aesthetic.
Good for
- Data value loading reveals
- Developer tool interface text
- Cyberpunk and tech aesthetic animations
- Hero heading entrance effects