Create beautiful text gradients using Tailwind CSS classes
bg-clip-text text-transparent bg-gradient-to-r from-blue-500 via-purple-500 to-pink-500 text-3xl font-bold
Text gradients add visual hierarchy and modern styling to key UI elements. For more advanced text effects, you might want to explore our 3D border generator to create depth. Common use cases:
bg-clip-text text-transparent bg-gradient-to-r from-color via-color to-color
This combination of utilities creates the gradient effect:
bg-clip-text – Clips background to text shapetext-transparent – Makes text fill transparentbg-gradient-to-{direction} – Creates gradient backgroundfrom/to/via-{color} – Defines gradient color stops<h1 class="bg-clip-text text-transparent bg-gradient-to-r from-blue-500 to-purple-600">
Gradient Heading
</h1>
<button class="transition-all hover:bg-clip-text hover:text-transparent
hover:bg-gradient-to-r hover:from-pink-500 hover:to-orange-400">
Hover Me
</button>
<h2 class="bg-clip-text text-transparent
bg-gradient-to-r from-blue-400 to-purple-500
md:bg-gradient-to-tr md:from-green-400 md:to-teal-500">
Responsive Gradient
</h2>
will-change: background for complex animationsbg-clip-text requires -webkit- prefix for full compatibilityvia-{color} for midpointsYes, combine with Tailwind's dark variant: dark:from-gray-300 dark:to-gray-100. Ensure gradients remain readable in both modes.
2-3 colors work best for readability. More than 4 can appear muddy. Use via-{color} for intermediate stops.
No, CSS gradients don't impact SEO. However, ensure text remains selectable and accessible to search engines.
Yes, use CSS animations or Tailwind's hover: variants. The tool's animation option provides a smooth moving gradient effect.
Trust & Privacy: This tool runs entirely in your browser. No code is sent to servers, no tracking, no data collection. Generated code is yours to use immediately.
Updated for Tailwind CSS v3.3+ compatibility. Tested across modern browsers.
const GradientHeading = ({ children }) => (
<h1 className="bg-clip-text text-transparent
bg-gradient-to-r from-blue-500 to-purple-600
text-4xl font-bold">
{children}
</h1>
);
<template>
<span :class="gradientClasses">
{{ text }}
</span>
</template>
<script setup>
const gradientClasses = 'bg-clip-text text-transparent bg-gradient-to-r from-pink-500 to-orange-400'
</script>