Shimmer Text
Shimmer Text is a React and Tailwind CSS effect component from Prompt Kit, licensed MIT. Copy it and paste it into your project.
Prompt Kit
MIT
effects
What it is
Shimmer Text is a React and Tailwind CSS effect component from Prompt Kit, licensed MIT. Copy it and paste it into your project.
How to use it
Open it in the catalogue, press copy, and paste it into your project. The prompt you copy carries the code and the rules that tell your agent to reproduce it without changing anything.
Five free copies a month. No card.
No packages beyond the project baseline
Licence
This component comes from Prompt Kit and is redistributed under the MIT licence, which permits commercial use. The copyright notice travels with the code.
Shimmer Text
"use client"
import { cn } from "@/lib/utils"
export type TextShimmerProps = {
as?: string
duration?: number
spread?: number
children: React.ReactNode
} & React.HTMLAttributes<HTMLElement>
export function TextShimmer({
as = "span",
className,
duration = 4,
spread = 20,
children,
...props
}: TextShimmerProps) {
const dynamicSpread = Math.min(Math.max(spread, 5), 45)
const Component = as as React.ElementType
return (
<Component
className={cn(
"bg-size-[200%_auto] bg-clip-text font-medium text-transparent",
"animate-[shimmer_4s_infinite_linear]",
className
)}
style={{
backgroundImage: `linear-gradient(to right, var(--muted-foreground) ${50 - dynamicSpread}%, var(--foreground) 50%, var(--muted-foreground) ${50 + dynamicSpread}%)`,
animationDuration: `${duration}s`,
}}
{...props}
>
{children}
</Component>
)
}