Animated Gradient Text
magicui/animated-gradient-textFreeComponent
An animated gradient background which transitions between colors for text.
Live preview
live · rendered by the registry
Rendered by magicui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://magicui.design/r/animated-gradient-text.jsonSource
1import { type ComponentPropsWithoutRef } from "react"23import { cn } from "@/lib/utils"45export interface AnimatedGradientTextProps extends ComponentPropsWithoutRef<"div"> {6 speed?: number7 colorFrom?: string8 colorTo?: string9}1011export function AnimatedGradientText({12 children,13 className,14 speed = 1,15 colorFrom = "#ffaa40",16 colorTo = "#9c40ff",17 ...props18}: AnimatedGradientTextProps) {19 return (20 <span21 style={22 {23 "--bg-size": `${speed * 300}%`,24 "--color-from": colorFrom,25 "--color-to": colorTo,26 } as React.CSSProperties27 }28 className={cn(29 `animate-gradient inline bg-linear-to-r from-(--color-from) via-(--color-to) to-(--color-from) bg-size-[var(--bg-size)_100%] bg-clip-text text-transparent`,30 className31 )}32 {...props}33 >34 {children}35 </span>36 )37}
Files it writes
More from magicui
All 247 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Androidandroid | magicui | Components | Free | no deps | |
| Animated Beamanimated-beam | magicui | Components | Free | 1 dep | |
| Animated Circular Progress Baranimated-circular-progress-bar | magicui | Components | Free | no deps | |
| Animated Grid Patternanimated-grid-pattern | magicui | Components | Free | 1 dep | |
| Animated Listanimated-list | magicui | Components | Free | 1 dep | |
| Animated Shiny Textanimated-shiny-text | magicui | Components | Free | no deps | |
| Theme Toggleranimated-theme-toggler | magicui | Components | Free | 1 dep | |
| Aurora Textaurora-text | magicui | Components | Free | no deps |
