BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/refinery/terminal-text

Terminal Text

refinery/terminal-text
FreeComponent

Typewriter-style terminal text loop with blinking cursor and optional prefix.

Live preview

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

Install it

npx shadcn@latest add https://refinery.abhii.me/r/terminal-text.json

Source

registry/default/text-effects/terminal-text.tsxrefinery.abhii.me/r/terminal-text.json
1"use client";
2
3import { useEffect, useState } from "react";
4import { motion } from "motion/react";
5import { cn } from "@/lib/utils";
6
7const TYPE_SPEED = 55;
8const DELETE_SPEED = 28;
9const HOLD_TIME = 850;
10const SWITCH_DELAY = 120;
11
12export const previewTexts = [
13 "build things that matter",
14 "simplicity is the ultimate sophistication",
15 "ship it. then make it better.",
16 "who let the dogs out",
17 "woff woff woff woff",
18];
19
20interface TerminalTextProps {
21 texts?: string[];
22 prefix?: string;
23 className?: string;
24}
25
26type TypeState = {
27 index: number;
28 visibleLength: number;
29 isDeleting: boolean;
30};
31
32function getNextState(state: TypeState, textLength: number, totalText: number) {
33 const { index, visibleLength, isDeleting } = state;
34
35 if (!isDeleting && visibleLength < textLength) {
36 return {
37 next: { ...state, visibleLength: visibleLength + 1 },
38 delay: TYPE_SPEED,
39 };
40 }
41 if (!isDeleting && visibleLength === textLength) {
42 return { next: { ...state, isDeleting: true }, delay: HOLD_TIME };
43 }
44 if (isDeleting && visibleLength > 0) {
45 return {
46 next: { ...state, visibleLength: visibleLength - 1 },
47 delay: DELETE_SPEED,
48 };
49 }
50 return {
51 next: {
52 index: (index + 1) % totalText,
53 visibleLength: 0,
54 isDeleting: false,
55 },
56 delay: SWITCH_DELAY,
57 };
58}
59
60export function TerminalText({
61 texts = previewTexts,
62 prefix,
63 className = "text-emerald-600 dark:text-emerald-400",
64}: TerminalTextProps) {
65 const [state, setState] = useState<TypeState>({
66 index: 0,
67 visibleLength: 0,
68 isDeleting: false,
69 });
70
71 const resolvedTexts = texts.length > 0 ? texts : previewTexts;
72 const text = resolvedTexts[state.index % resolvedTexts.length];
73 const visibleText = text.slice(0, state.visibleLength);
74
75 useEffect(() => {
76 const { next, delay } = getNextState(
77 state,
78 text.length,
79 resolvedTexts.length
80 );
81 const id = setTimeout(() => setState(next), delay);
82 return () => clearTimeout(id);
83 }, [state, text, resolvedTexts.length]);
84
85 return (
86 <motion.div
87 aria-live="polite"
88 className={cn("flex items-center font-mono tracking-[0.08em]", className)}
89 >
90 <span className="whitespace-nowrap">
91 {prefix && <span className="text-current/40">{prefix}</span>}
92 {visibleText}
93 <motion.span
94 aria-hidden="true"
95 animate={{ opacity: [1, 0, 1] }}
96 transition={{
97 duration: 0.9,
98 repeat: Infinity,
99// … truncated

What it pulls in

npm packages

  • motion

Files it writes

  • registry/default/text-effects/terminal-text.tsx

Facts

Registry
refinery
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
today

Go to the source

Docs on refinery refinery.abhii.me mrap10/refinery on GitHub Raw registry item This item as JSON

More from refinery

All 16 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Analog Clock Screensaveranalog-clock-screensaverrefineryComponentsFree1 dep
Avatar Circleavatar-circlerefineryComponentsFree1 dep
DVD Screensaverdvd-screensaverrefineryComponentsFree1 dep
Floating Cardfloating-cardrefineryComponentsFree1 dep
Floating Navfloating-navrefineryComponentsFree1 dep
Glowy Buttonglowy-buttonrefineryComponentsFree1 dep
Move To Topmove-to-top-buttonrefineryComponentsFree1 dep
Notification Badgenotification-badgerefineryComponentsFree1 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