React Gradient Text
React gradient text with smooth flowing colors and neon effects. Built with Framer Motion, TypeScript, and shadcn/ui for Next.js apps.
Powered by
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:
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:
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.
Prop | Type | Default | Description |
---|---|---|---|
text | string | required | Text content to display |
gradient | string | Default blue-purple-pink | CSS gradient string |
neon | boolean | false | Enable neon glow effect |
transition | Transition | { duration: 50, repeat: Infinity, ease: 'linear' } | Animation configuration |
className | string | - | Additional CSS classes |
...props | HTMLAttributes<HTMLSpanElement> | - | Standard span attributes |
Gradient Presets
Common gradient combinations that actually look good:
Style | Gradient |
---|---|
Sunset | linear-gradient(90deg, #ff7e5f 0%, #feb47b 100%) |
Ocean | linear-gradient(90deg, #667eea 0%, #764ba2 100%) |
Neon Green | linear-gradient(90deg, #39ff14 0%, #00ff41 100%) |
Fire | linear-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.
Related text components you will also like
Colourful Text
Vibrant color transitions and rainbow text effects
Shimmering Text
Wave-like shimmer effects that flow naturally across text
Glitch Text
Digital glitch effects with RGB channel separation
Highlight Text
Smooth expanding background highlights like real markers
Fuzzy Text
Soft blur transitions with particle-like text effects
Text Generate Effect
Progressive character generation with realistic typing timing
Questions developers actually ask
React Glitch Text
Cyberpunk-style glitchy text effect with customizable speed and shadows. Perfect for React applications requiring digital distortion animations.
React Highlight Text
React text highlighting with smooth expanding backgrounds. Animate highlights from zero to emphasize phrases using Motion, TypeScript, and shadcn/ui.