Smart CSS Gradient Generator
Create beautiful modern gradients visually with live preview, draggable color stops, angle dial, Tailwind export, and preset library.
How to use
Choose gradient type
Select Linear, Radial, or Conic gradient type. Linear creates diagonal or directional transitions; Radial radiates from a center point; Conic rotates around a point like a pie chart.
Edit color stops
Drag the handles on the gradient bar to reposition stops. Click any empty area on the bar to add a new stop at that position. Use the color picker, hex input, and opacity slider to fine-tune each stop.
Set the angle
Drag the circular dial or type an angle to control the gradient direction. Use the 8 quick-direction buttons for common angles (→ ↘ ↓ ↙ ← ↖ ↑ ↗). Presets auto-apply sensible angles.
Copy and export
Copy the CSS or Tailwind class string with one click. For SVG export, click 'Export as SVG' to download a scalable gradient file. Use in any project immediately.
When to use CSS gradients
Hero backgrounds
Gradient hero sections are a staple of modern SaaS landing pages — they create depth and visual interest without the performance cost of images.
CTA buttons
Gradient buttons stand out more than flat buttons and signal interactivity. A subtle gradient is especially effective on primary action buttons.
Card headers
Gradient card headers create visual hierarchy and polish. They work well for pricing cards, feature cards, and dashboard widgets.
Gradient text
Gradient text creates bold typographic moments for taglines, headings, and emphasis text. Achieved with background-clip: text and -webkit-text-fill-color: transparent.
Progress indicators
Conic gradients are perfect for circular progress bars and pie charts — they create smooth visual feedback without canvas or SVG complexity.
Patterns & textures
Repeating gradients create CSS-only diagonal stripes, grid patterns, and textured backgrounds — no external images or SVGs needed.
How it works
Gradient engine
The CSS gradient is rebuilt in real time from the sorted color stop array. Each stop carries a position (0–100%), color, and opacity. Opacity below 1 switches the output from hex to rgba().
Draggable stops
Mouse and touch events on the gradient bar are handled via document-level listeners attached once on mount (useRef for drag ID per CLAUDE.md), preventing stale closures and re-registration on every render.
Tailwind exporter
For linear gradients at standard angles the exporter produces bg-gradient-{dir} with JIT color classes. For arbitrary angles or more than 3 stops it falls back to a bg-[...] arbitrary value string.
SVG export
The SVG generator converts the angle to x1/y1/x2/y2 gradient coordinates (rotated from the CSS convention), embeds all color stops, and downloads an 800×500 SVG ready for design tools.
Related tools
Frequently asked questions
Quick answers about this free online tool.
