Join our Discord Community

React Gradient Text

Gradient text that doesn't look like a rainbow threw up. Smooth flowing colors with optional neon effects for React. Built with Framer Motion, TypeScript, and shadcn/ui integration for Next.js applications.

Trying to implement text animations?

Join our Discord community for help from other developers.


Ever seen gradient text that looks like someone spilled paint? Most implementations just slap a static gradient and call it a day. This component actually animates the gradient smoothly, creating that flowing color effect you see in modern interfaces. No janky transitions, no rainbow disasters.

Animated gradient text effects

Text with smooth flowing gradients that don't hurt your eyes:

Loading component...

Built with TypeScript and shadcn/ui, using Framer Motion for buttery smooth animations in React applications. The gradient flows naturally across the text, and you can enable neon glow effects for that cyberpunk aesthetic without looking like a Vegas casino in your Next.js projects.

Installation

npx shadcn@latest add https://www.shadcn.io/registry/gradient-text.json
npx shadcn@latest add https://www.shadcn.io/registry/gradient-text.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/gradient-text.json
bunx shadcn@latest add https://www.shadcn.io/registry/gradient-text.json

Usage

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

<GradientText
  text="Smooth flowing gradients"
  gradient="linear-gradient(90deg, #3b82f6 0%, #a855f7 50%, #ec4899 100%)"
/>;

Why most gradient text looks terrible

Most developers either use static gradients (boring) or animate them with CSS keyframes (choppy) in their React components. The problem? CSS animations can't smoothly interpolate complex gradients, so you get these jarring color jumps in JavaScript applications.

This React component moves the gradient background position instead of morphing colors, with full TypeScript support for precise control. The gradient itself stays consistent—we just slide it across the text. Result? Smooth, continuous color flow that your eyes can actually follow in Next.js projects.

Plus, when developers add "neon effects," they usually just throw a text-shadow and call it done. Looks fake. This component layers a blurred duplicate with proper blend modes, creating actual light bleed like real neon signs in modern JavaScript frameworks.

Examples

Neon cyberpunk effect

For when you want that futuristic vibe without looking like a 90s hacker movie:

Loading component...

Features

  • Smooth gradient animations that don't cause seizures in React applications
  • Neon glow effects that actually look like real neon in JavaScript projects
  • Any CSS gradient works (linear, radial, conic) with Next.js compatibility
  • 60fps animations using Framer Motion optimization for performance
  • Complete TypeScript support with full type definitions and IntelliSense
  • Works seamlessly with shadcn/ui typography classes out of the box
  • Free open source component that respects user motion preferences

API Reference

GradientText

Animated gradient text with flowing color effects.

PropTypeDefaultDescription
textstringrequiredText content to display
gradientstringDefault blue-purple-pinkCSS gradient string
neonbooleanfalseEnable neon glow effect
transitionTransition{ duration: 50, repeat: Infinity, ease: 'linear' }Animation configuration
classNamestring-Additional CSS classes
...propsHTMLAttributes<HTMLSpanElement>-Standard span attributes

Gradient Presets

Common gradient combinations that actually look good:

StyleGradient
Sunsetlinear-gradient(90deg, #ff7e5f 0%, #feb47b 100%)
Oceanlinear-gradient(90deg, #667eea 0%, #764ba2 100%)
Neon Greenlinear-gradient(90deg, #39ff14 0%, #00ff41 100%)
Firelinear-gradient(90deg, #f12711 0%, #f5af19 100%)

Common gotchas

Gradient looks choppy: Make sure your gradient has enough color stops and the animation duration isn't too fast in React applications. 50 seconds is the sweet spot for smooth flow with TypeScript timing controls.

Text becomes unreadable: High contrast gradients with neon effects can hurt readability in JavaScript implementations. Test with actual content, not just "Hello World."

Performance issues on mobile: The blur effect for neon mode is expensive in React components. Consider disabling neon on lower-end devices or add a reduced motion check in Next.js projects.

Background clips incorrectly: Some browsers handle background-clip: text differently. This component includes fallbacks, but always test across browsers in your JavaScript applications.

Animation stutters: If you're updating the text prop frequently in your React application, the animation restarts each time. For dynamic content, consider using a key prop to control when to restart.

Integration with other components

Perfect for hero sections with Card components as backgrounds in React applications. Combine with Button for call-to-action text in Next.js projects. Works well with Badge components for status indicators with style.

For complete brand experiences, pair with Avatar for profile names or Tabs for navigation with personality. This free open source component's animation speed matches well with Skeleton loading states, all with complete TypeScript integration.

Questions developers actually ask