Skip to content
VenusUI
Get started

Gradient Text

Text filled with a slowly moving gradient: a subtle sheen by default, or your own colors.

Preview

Installation

npx shadcn@latest add @venusui/gradient-text

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/gradient-text.tsx

Usage

The code behind the preview above.

gradient-text-demo.tsx

import { GradientText } from "@/components/ui/gradient-text"

export default function GradientTextDemo() {
  return (
    <div className="space-y-4 text-center">
      <h2 className="text-4xl font-semibold tracking-tight">
        <GradientText>Quietly animated headline</GradientText>
      </h2>
      <p className="text-2xl font-semibold">
        <GradientText colors={["#6366f1", "#06b6d4", "#10b981"]}>With your own colors</GradientText>
      </p>
    </div>
  )
}

API reference

PropTypeDefaultDescription
colorsstring[]—Gradient colors, left to right. Defaults to a sheen of the text color.
animatebooleantrueSlowly move the gradient.

All <span> props, including className and style.

Requirements

  • Tailwind CSS v4. The CLI adds the gradient-text keyframes and --animate-gradient-text to your CSS.
  • Works in Server Components.

Customization

  • Use brand colors sparingly: one gradient word in a headline reads better than a whole paragraph.
  • Pass animate={false} for a static gradient.

Accessibility

  • The text stays real text. Check contrast at both ends of your gradient against the background.
  • The movement stops when the user prefers reduced motion.

Troubleshooting

The text is invisible.
It uses bg-clip-text with transparent text. Another class that sets a background color on the same element will hide it.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

Blur Text

Text animations

Text whose words rise out of a blur one after another.

Loading preview

Number Ticker

Text animations

Counts up to a number when it scrolls into view, with locale-aware formatting.

Loading preview

Rotating Words

Text animations

Cycles through words with a vertical slide, pausing on hover.