UIPin
ComponentsIconsIllustrationsMotionTemplatesApps
Boards
UIPin

Free, open-source UI components, icons, illustrations, motion, templates and apps, in one search. Every item links to its source and licence.

UIPin is free. If it saved you time, you can keep it running:

Buy me a coffee
ComponentsIconsIllustrationsMotionTemplatesAppsLibrariesCompareNew this weekMCP for agentsBoardsPrivacy

Components, icons and artwork belong to their authors and are shown under their open-source licences.

Magic UI/Animated Gradient Text

Text effects
1 of 25
Compiling

Theme it

Every preview, live

Brand colour

Corner radius

Font

Recolours shadcn’s tokens, Tailwind’s accent colours and colours set in the code. Red, amber and green classes stay, since they usually mean error, warning or success.

25 versions·5 librariesCompare all text animations →

  • Animated Gradient Text
  • React Bits
  • Gradient Heading
  • Text Animate
  • Text Gif
  • Blur In Text
  • Dock Text
  • Fade Text
  • Font Weight Text
  • Gradual Spacing Text
  • Letter Pull Up Text
  • Multi Direction Slide Text
  • Scale Letter Text
  • Seperate Away Text
  • Wavy Text
  • Word Pull Up Text
  • Ai Text Loading
  • Cradle Text
  • Plucked Text
  • Swoosh Text
  • Animated Shiny Text
  • Comic Text
  • Dia Text Reveal
  • Hyper Text
  • Kinetic Text

Animated Gradient Text

An animated gradient background which transitions between colors for text.

npx shadcn@latest add https://magicui.design/r/animated-gradient-text.json
Open in v0 Docs Repo
Library
Magic UI
License
MIT
Stack
React · Tailwind CSS
Packages
lucide-react
Size
38 lines
Demo
From Magic UI

Code

registry/magicui/animated-gradient-text.tsx

import { type ComponentPropsWithoutRef } from "react"

import { cn } from "@/lib/utils"

export interface AnimatedGradientTextProps extends ComponentPropsWithoutRef<"div"> {
  speed?: number
  colorFrom?: string
  colorTo?: string
}

export function AnimatedGradientText({
  children,
  className,
  speed = 1,
  colorFrom = "#ffaa40",
  colorTo = "#9c40ff",
  ...props
}: AnimatedGradientTextProps) {
  return (
    <span
      style={
        {
          "--bg-size": `${speed * 300}%`,
          "--color-from": colorFrom,
          "--color-to": colorTo,
        } as React.CSSProperties
      }
      className={cn(
        `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`,
        className
      )}
      {...props}
    >
      {children}
    </span>
  )
}

More like this

Animated Shiny Text

Magic UI·Text effects

Dia Text Reveal

Magic UI·Text effects

Sparkles Text

Magic UI·Text effects

Text Reveal

Magic UI·Text effects

Cool Mode

Magic UI·Buttons

Animated Shiny Button

Eldora UI·Text effects

Live Button

Eldora UI·Buttons

Terminal

Eldora UI·Media & 3D

Toolbar Expandable

Motion Primitives·Navigation

Toolbar Dynamic

Motion Primitives·Navigation

Carousel

HextaUI·Media & 3D

Input Otp

shadcn/ui·Inputs & forms

Button

shadcn/ui·Buttons

Side Panel

Cult UI·Other

Skeleton

shadcn/ui·Feedback & loaders