BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/atlas-ui/hacker-text

Hacker Text

atlas-ui/hacker-text
FreeComponent

A text animation that scrambles letters before revealing the final text.

Live preview

live · rendered by the registry
Rendered by atlas-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://atlasui.dev/r/hacker-text.json

Source

registry/react/atlasui/hacker-text.tsxatlasui.dev/r/hacker-text.json
1"use client";
2
3import { useEffect } from "react";
4
5import { Bebas_Neue } from "next/font/google";
6
7import { cn } from "@/lib/utils";
8
9const bebas = Bebas_Neue({ subsets: ["latin"], weight: ["400"] });
10
11export const HackerText = ({
12 text,
13 className,
14}: {
15 text: string;
16 className?: string;
17}) => {
18 const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
19
20 useEffect(() => {
21 const textElement = document.getElementById("text");
22 let interval: NodeJS.Timeout | null = null;
23 let timeout: NodeJS.Timeout | null = null;
24
25 const scrambleText = (target: HTMLElement) => {
26 let iteration = 0;
27
28 clearInterval(interval as NodeJS.Timeout);
29
30 interval = setInterval(() => {
31 if (!target.dataset.value) return;
32
33 target.innerText = target.innerText
34 .split("")
35 .map((letter, index) => {
36 if (index < iteration) {
37 return target.dataset.value![index];
38 }
39 return letters[Math.floor(Math.random() * 26)];
40 })
41 .join("");
42
43 if (iteration >= target.dataset.value.length) {
44 clearInterval(interval as NodeJS.Timeout);
45 }
46
47 iteration += 1 / 3;
48 }, 30);
49 };
50
51 const applyEffect = () => {
52 if (window.matchMedia("(min-width: 768px)").matches) {
53 // For non-mobile devices
54 if (textElement) {
55 textElement.addEventListener("mouseover", (event) => {
56 const target = event.target as HTMLElement;
57 scrambleText(target);
58 });
59 }
60 }
61 // Run the effect after 600ms on page load for all devices
62 if (textElement) {
63 timeout = setTimeout(() => {
64 scrambleText(textElement);
65 }, 600);
66 }
67 };
68
69 applyEffect();
70
71 return () => {
72 if (textElement && window.matchMedia("(min-width: 768px)").matches) {
73 textElement.removeEventListener("mouseover", (event) => {
74 const target = event.target as HTMLElement;
75 scrambleText(target);
76 });
77 }
78 if (interval) {
79 clearInterval(interval);
80 }
81 if (timeout) {
82 clearTimeout(timeout);
83 }
84 };
85 }, [letters]);
86 return (
87 <span
88 id="text"
89 data-value={text}
90 className={cn("text-4xl uppercase", bebas.className, className)}
91 >
92 {text}
93 </span>
94 );
95};

What it pulls in

Other registry items

  • utils

Files it writes

  • registry/react/atlasui/hacker-text.tsx

Facts

Registry
atlas-ui
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

Docs on atlas-ui atlasui.dev SnehdeepDupare/atlas-ui on GitHub Raw registry item This item as JSON

More from atlas-ui

All 99 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Mobile Navbaranimated-mobile-navbaratlas-uiComponentsFree2 deps
Blend Mouse Trailerblend-mouse-traileratlas-uiComponentsFree1 dep
Blob Mouse Trailerblob-mouse-traileratlas-uiComponentsFree1 dep
Box Revealbox-revealatlas-uiComponentsFree1 dep
Cascade Textcascade-textatlas-uiComponentsFree1 dep
Dot And Circle Mouse Trailerdot-and-circle-mouse-traileratlas-uiComponentsFree1 dep
Fancy Theme Togglefancy-theme-toggleatlas-uiComponentsFree1 dep
Letter Swapletter-swapatlas-uiComponentsFree1 dep
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex