Make your AI a shadcn expert

Rainbow Text

Continuously rolling rainbow gradient text with seamless horizontal panning across the full hue range for React, Next.js, Tailwind CSS, and motion.

Rainbow Text preview

Scroll to load preview

A long horizontal rainbow that perpetually rolls across the glyphs, painted via a single 200%-wide linear-gradient clipped to the text. Unlike per-letter color cycling, the gradient is one continuous ribbon — every letter at any given moment shares a slice of the same arc, so the eye reads a smooth procession of color rather than a noisy palette swap. The pan is driven by motion's useTime + useTransform, so background-position translates frame-perfectly without React re-renders or layout work. Saturation and lightness are exposed as props and tuned by default to stay readable on both light and dark backgrounds — the same rainbow holds its own on a white hero or a near-black gradient. Drop it on a pride banner, a fun-tech CTA, or any place a static gradient feels too still.

Install with AI

If you've connected the shadcn.io MCP server to Claude Code, Cursor, Windsurf, or any MCP-ready AI editor, prompt your agent to install this text effect for you — no copy-paste, no CLI:

use shadcnio to install the rainbow-text text effect into my project

FAQ

Was this page helpful?

Sign in to leave feedback.