Tailwind CSS Gradient Generator
Build beautiful gradients with Tailwind CSS classes and live preview
Preset Gradients
Pick a direction, select your Tailwind palette colors, and see the gradient update live — then copy the exact utility classes or raw CSS straight into your project. No more flipping between docs to remember if it's from-, via-, or to-, or squinting at hex values that don't match the shade you actually wanted.
The preset gallery gives you a head start with popular combinations you can tweak from there. And everything runs in your browser. Nothing gets uploaded.
How It Works
You select a gradient direction (like to-r for left-to-right), then pick From, Via, and To colors from Tailwind's palette. The tool builds the correct class string — bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 — and generates the equivalent CSS background-image property at the same time. One click copies either version.
Examples
Sunset Hero Banner
A warm left-to-right gradient for a landing page header section.
Direction: to-r
From: orange-400
Via: rose-500
To: purple-600
bg-gradient-to-r from-orange-400 via-rose-500 to-purple-600
Dark Mode Card Background
Subtle diagonal gradient for a card component in a dark UI. Two stops only — no via color needed.
Direction: to-br
From: slate-800
To: gray-900
bg-gradient-to-br from-slate-800 to-gray-900
CTA Button Gradient
Eye-catching gradient for button backgrounds on a SaaS pricing page. The CSS output works if you are not using Tailwind in that particular project.
Direction: to-r
From: cyan-400
Via: blue-500
To: indigo-600
bg-gradient-to-r from-cyan-400 via-blue-500 to-indigo-600
CSS: background-image: linear-gradient(to right, #22d3ee, #3b82f6, #4f46e5);
Who Uses This
Building Tailwind components and want the exact class string without checking docs every time.
Prototyping color schemes and handing off correct Tailwind classes to devs.
Learning Tailwind's gradient syntax by seeing how direction and color stops map to classes.
Shipping landing pages fast and grabbing gradient code without slowing down.
Common Mistakes
Adding from-blue-500 to-green-500 without bg-gradient-to-r does nothing. The direction class is what enables the gradient — color stops alone won't show anything.
A via color adds a middle stop. If you want a simple blue-to-green blend, skip via entirely. Adding it creates a three-stop gradient that might look muddy or unexpected.
Going from blue-400 to blue-500 produces a gradient that looks like a solid color. Spread your shades apart — at least 200-300 difference — or use different color families for visible contrast.
Technical Details
- Processing: 100% client-side — nothing is uploaded or stored
- Browser Support: Chrome, Firefox, Safari, Edge
- Tailwind Version: Color palette matches Tailwind CSS v3.x
- Output Formats: Tailwind utility classes and raw CSS
- Offline: Works without internet after the page loads
Frequently Asked Questions
How do I make a gradient in Tailwind CSS?
Add bg-gradient-to-{direction} to your element, then set color stops with from-{color}, optionally via-{color}, and to-{color}. For example, bg-gradient-to-r from-blue-500 to-green-400 gives you a left-to-right blue-to-green gradient. The direction part is required — without it, the color stops do nothing.
What does "via" do in a Tailwind gradient?
The via class adds a middle color stop to your gradient. So from-red-500 via-yellow-500 to-green-500 blends from red through yellow to green. Without via, you get a direct two-color blend. It is completely optional — most simple gradients don't need it.
Can I use custom colors in Tailwind gradients?
Yes. In Tailwind v3+, you can write from-[#ff6b6b] using arbitrary value syntax. This generator sticks to the built-in palette so the output stays readable, but you can swap in custom hex values in your own code without any config changes.
How do I make a diagonal gradient in Tailwind?
Use one of the corner directions: bg-gradient-to-br (top-left to bottom-right), bg-gradient-to-bl, bg-gradient-to-tr, or bg-gradient-to-tl. These map to CSS values like to bottom right. The generator lets you click a direction and see the result right away.
Is this gradient generator free to use?
Completely free, no signup, no limits. The tool runs in your browser so there's nothing to pay for. Use it as many times as you want — for personal projects, client work, whatever. The generated code is yours.