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/typewriter

Typewriter

atlas-ui/typewriter
FreeComponent

A typewriter component that cycles through text with a synced flashing highlight animation.

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/typewriter.json

Source

registry/react/atlasui/typewriter.tsxatlasui.dev/r/typewriter.json
1"use client";
2
3import { useEffect, useState } from "react";
4
5import { AnimatePresence, motion } from "motion/react";
6
7import { cn } from "@/lib/utils";
8
9interface TypewriterProps {
10 /**
11 * Array of strings to display
12 */
13 text: string[];
14 /**
15 * Delay between each letter (in seconds)
16 * @default 0.025
17 */
18 letterDelay?: number;
19 /**
20 * Duration of the box fade (in seconds)
21 * @default 0.125
22 */
23 boxFadeDuration?: number;
24 /**
25 * Duration of the text fade out (in seconds)
26 * @default 0.25
27 */
28 textFadeOutDuration?: number;
29 /**
30 * Delay between each text fade out (in ms)
31 * @default 5500
32 */
33 delayBetween?: number;
34 /**
35 * Additional classNames
36 */
37 className?: string;
38}
39
40export const Typewriter = ({
41 text,
42 letterDelay = 0.025,
43 boxFadeDuration = 0.125,
44 textFadeOutDuration = 0.25,
45 delayBetween = 5500,
46 className,
47}: TypewriterProps) => {
48 const [currentIndex, setCurrentIndex] = useState(0);
49
50 useEffect(() => {
51 const intervalId = setInterval(() => {
52 setCurrentIndex((prevIndex) => (prevIndex + 1) % text.length);
53 }, delayBetween);
54
55 return () => clearInterval(intervalId);
56 }, []);
57
58 return (
59 <p className={cn("text-sm font-light uppercase", className)}>
60 <AnimatePresence mode="wait">
61 <motion.span
62 key={currentIndex}
63 initial={{ opacity: 1 }}
64 exit={{ opacity: 0 }}
65 transition={{
66 duration: textFadeOutDuration,
67 ease: "easeInOut",
68 }}
69 >
70 {text[currentIndex].split("").map((char, index) => (
71 <span key={index} className="relative">
72 <motion.span
73 initial={{ opacity: 0 }}
74 animate={{ opacity: 1 }}
75 transition={{ delay: index * letterDelay, duration: 0 }}
76 >
77 {char}
78 </motion.span>
79 <motion.span
80 initial={{ opacity: 0 }}
81 animate={{ opacity: [0, 1, 0] }}
82 transition={{
83 delay: index * letterDelay,
84 times: [0, 0.1, 1],
85 duration: boxFadeDuration,
86 ease: "easeInOut",
87 }}
88 className="bg-foreground absolute inset-x-0.25 inset-y-0"
89 />
90 </span>
91 ))}
92 </motion.span>
93 </AnimatePresence>
94 </p>
95 );
96};

What it pulls in

npm packages

  • motion

Files it writes

  • registry/react/atlasui/typewriter.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
Hacker Texthacker-textatlas-uiComponentsFreeno deps
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