BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/lyminhnghia/shimmering-text

Shimmering Text

lyminhnghia/shimmering-text
FreeComponent

Smooth, light-sweeping shimmer animation for text.

Install it

npx shadcn@latest add https://lyminhnghia.github.io/r/shimmering-text.json

Source

src/registry/components/shimmering-text/shimmering-text.tsxlyminhnghia.github.io/r/shimmering-text.json
1"use client"
2
3import type { Variants } from "motion/react"
4import { motion } from "motion/react"
5import * as React from "react"
6
7import { cn } from "@/lib/utils"
8
9export type ShimmeringTextProps = Omit<
10 React.ComponentProps<typeof motion.span>,
11 "children"
12> & {
13 /** The text to render with the shimmering effect. */
14 text: string
15 /**
16 * Duration in seconds for one shimmer cycle.
17 * @defaultValue 1 */
18 duration?: number
19 /**
20 * Whether the shimmer animation is paused.
21 * @defaultValue false */
22 isStopped?: boolean
23}
24
25export function ShimmeringText({
26 text,
27 duration = 1,
28 isStopped = false,
29 className,
30 ...props
31}: ShimmeringTextProps) {
32 const createCharVariants = React.useCallback(
33 (charIndex: number): Variants => ({
34 running: {
35 color: ["var(--color)", "var(--shimmering-color)", "var(--color)"],
36 transition: {
37 duration,
38 repeat: Infinity,
39 repeatType: "loop" as const,
40 repeatDelay: text.length * 0.05,
41 delay: (charIndex * duration) / text.length,
42 ease: "easeInOut",
43 },
44 },
45 stopped: {
46 color: "var(--color)",
47 transition: {
48 duration: duration * 0.5,
49 ease: "easeOut",
50 },
51 },
52 }),
53 [duration, text.length]
54 )
55
56 return (
57 <motion.span
58 className={cn(
59 "inline-block select-none",
60 "[--color:var(--muted-foreground)] [--shimmering-color:var(--foreground)]",
61 className
62 )}
63 {...props}
64 >
65 {text?.split("")?.map((char, i) => (
66 <motion.span
67 key={i}
68 className="inline-block whitespace-pre"
69 initial="stopped"
70 animate={isStopped ? "stopped" : "running"}
71 variants={createCharVariants(i)}
72 >
73 {char}
74 </motion.span>
75 ))}
76 </motion.span>
77 )
78}

What it pulls in

npm packages

  • motion

Files it writes

  • src/registry/components/shimmering-text/shimmering-text.tsx

Facts

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

Go to the source

lyminhnghia.github.io lyminhnghia/lyminhnghia.github.io on GitHub Raw registry item This item as JSON

More from lyminhnghia

All 26 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Apple Hello Effectapple-hello-effectlyminhnghiaComponentsFree1 dep
chevrons-up-down-iconchevrons-up-down-iconlyminhnghiaComponentsFreeno deps
Code Block Commandcode-block-commandlyminhnghiaComponentsFree4 deps · 3 files
Consent Managerconsent-managerlyminhnghiaComponentsFree1 dep
Copy Buttoncopy-buttonlyminhnghiaComponentsFree2 deps · 2 files
GitHub Starsgithub-starslyminhnghiaComponentsFreeno deps
Scroll Fade Effectscroll-fade-effectlyminhnghiaComponentsFreeno deps
Slide to Unlockslide-to-unlocklyminhnghiaComponentsFree1 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