BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/ui-beats/text-scramble

Text Scramble

ui-beats/text-scramble
FreeComponent

The TextScramble component decodes text one character at a time, cycling through random glyphs before each letter settles into place.

Install it

npx shadcn@latest add https://uibeats.com/r/text-scramble.json

Source

components/demo/text/text-scramble.tsxuibeats.com/r/text-scramble.json
1"use client";
2
3import { useCallback, useEffect, useRef, useState } from "react";
4import { useReducedMotion } from "motion/react";
5
6interface TextScrambleProps {
7 text: string;
8 /** Characters cycled through before a letter settles. */
9 characters?: string;
10 /** Milliseconds between scramble frames. */
11 speed?: number;
12 /** Frames each character scrambles before locking in. */
13 scrambleCount?: number;
14 /** Re-run the effect whenever the pointer enters the text. */
15 scrambleOnHover?: boolean;
16 className?: string;
17}
18
19const DEFAULT_CHARS = "!<>-_\\/[]{}—=+*^?#________";
20
21/**
22 * Decodes text one character at a time, cycling through random glyphs before
23 * each letter settles.
24 */
25export function TextScramble({
26 text,
27 characters = DEFAULT_CHARS,
28 speed = 40,
29 scrambleCount = 6,
30 scrambleOnHover = true,
31 className = "",
32}: TextScrambleProps) {
33 const prefersReducedMotion = useReducedMotion();
34 const [display, setDisplay] = useState(text);
35 const [renderedText, setRenderedText] = useState(text);
36 const frameRef = useRef<ReturnType<typeof setInterval> | null>(null);
37
38 // React's "adjust state when a prop changes" pattern: resetting during render
39 // rather than in an effect avoids a wasted commit with stale text on screen.
40 if (text !== renderedText) {
41 setRenderedText(text);
42 setDisplay(text);
43 }
44
45 const stop = useCallback(() => {
46 if (frameRef.current) {
47 clearInterval(frameRef.current);
48 frameRef.current = null;
49 }
50 }, []);
51
52 /**
53 * Starts the scramble interval. Deliberately performs no synchronous state
54 * update, so it is safe to call from an effect body — the timer is the
55 * external system the effect subscribes to.
56 */
57 const run = useCallback(() => {
58 if (prefersReducedMotion) return;
59
60 stop();
61 let frame = 0;
62
63 frameRef.current = setInterval(() => {
64 const revealed = Math.floor(frame / scrambleCount);
65
66 if (revealed >= text.length) {
67 setDisplay(text);
68 stop();
69 return;
70 }
71
72 const next = text
73 .split("")
74 .map((char, index) => {
75 if (index < revealed || char === " ") return char;
76 return (
77 characters[Math.floor(Math.random() * characters.length)] ?? char
78 );
79 })
80 .join("");
81
82 setDisplay(next);
83 frame += 1;
84 }, speed);
85 }, [characters, prefersReducedMotion, scrambleCount, speed, stop, text]);
86
87// … truncated

What it pulls in

npm packages

  • motion

Files it writes

  • components/ui/text-scramble.tsx

Facts

Registry
ui-beats
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-13
Last confirmed
today

Go to the source

uibeats.com Raw registry item This item as JSON

More from ui-beats

All 34 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Beamanimated-beamui-beatsComponentsFree1 dep
Animated Listanimated-listui-beatsComponentsFree1 dep
Border Beamborder-beamui-beatsComponentsFree1 dep
Bouncebounceui-beatsComponentsFree1 dep
Card Stackcard-stackui-beatsComponentsFree1 dep
Dockdockui-beatsComponentsFree1 dep
Fade Infade-inui-beatsComponentsFree1 dep
Fade In Unblurfade-in-unblurui-beatsComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex