20 Tailwind CSS Text Gradient

18 Pure Tailwind2 Tailwind + JSPublished

20 Tailwind CSS text gradients for landing-page hero headings, image-free navbar wordmarks, animated hover-wipe effects, and gradient CTAs — spanning linear, radial, rainbow and vertical fills, metallic gold and neon glow, outline-stroke type, dark-mode toggles, and a bg-clip-text utility cheat sheet. Scoped under .ttg-NN for no-collision pasting, prefers-reduced-motion guarded, framework-agnostic.

Related20 CSS Text Gradient Effects20 CSS Neon Text Effects16 CSS Glitch Text Effects30 CSS Text Hover Effects30 Tailwind CSS Text Hover Effects

Premium upgradePartner: Untitled UI

Affiliate link

Building a whole Tailwind app, not just this component?

You just browsed 20 Tailwind text gradient. Untitled UI Pro unlocks 5,000+ components and sections and 250+ page examples for React, styled with Tailwind CSS v4. One licence is a one-time $349 with lifetime updates; teams start at $999.

Get Untitled UI Pro

Untitled UI React. We may earn a commission, at no extra cost to you.

01. Tailwind CSS Gradient Text Hero Heading (opens in a new tab)

Published

Pure Tailwind
The most-searched gradient-text pattern — a landing-page H1 whose last line is painted with bg-linear-135 from-* via-* to-* bg-clip-text text-transparent. One class list replaces the original's four-declaration CSS rule, and the same three colour tokens drive the headline, the announcement badge and the primary CTA.

03. Tailwind Gradient Text Logo for Navbar (opens in a new tab)

Published

Pure Tailwind
An image-free wordmark: Spectr in solid ink, um in a bg-linear-120 gradient, inside a responsive navbar. The specimen row proves the logo is resolution-independent from 20px to 56px — and a dark tile shows the same markup on an inverted surface. Zero HTTP requests, perfectly sharp on every DPI.

05. Tailwind Gradient Text on Hover Animation (opens in a new tab)

Published

Pure Tailwind
Hover any link or card and the gradient wipes across the letters from left to right. It's two background layers clipped to the text — a solid ink layer underneath and a gradient layer whose width animates from 0% to 100%. Unlike the original's instant swap, this is a real, interruptible transition.

06. Tailwind Gradient Text Button & Gradient Border Button (opens in a new tab)

Published

Pure Tailwind
Every gradient CTA in one panel: a ghost button with a gradient label, a true gradient-border button with rounded corners, and a filled gradient button whose colours slide on hover. The gradient border drops the original's mask-composite pseudo-element for a two-layer padding-box / border-box background — one element, no prefixes.
Newsletter

Enjoying these demos? Get new ones by email.

A short email when a new collection ships. Unsubscribe any time.

at

Almost there: check your inbox to confirm.Manage

Published

Tailwind + JS
A dashboard header where the current page is styled entirely from aria-current="page": a tinted pill, gradient label and a gradient underline that scales in. The script only moves one attribute — every visual lives in aria-[current=page]: and group-aria-[current=page]: variants, so styling and accessibility can never disagree.

09. Cyberpunk Neon Gradient Text in Tailwind CSS (opens in a new tab)

Published

Pure Tailwind
A CRT-lit HUD panel: pink, cyan and acid-yellow gradient type with drop-shadow-[0_0_10px_…] neon bloom, a scanline overlay drawn with repeating-linear-gradient, corner brackets and a shimmering sync bar. The CSS original's labels sat at 2:1 contrast; every label here clears 4.5:1 without losing the mood.

10. Tailwind Metallic Gold Gradient Text Effect (opens in a new tab)

Published

Pure Tailwind
A luxury membership card with real metallic gold: an eight-stop bronze → gold → near-white highlight → gold ramp, shared as one --ttg10-gold custom property and applied with bg-(image:--ttg10-gold). The highlight glides slowly across the wordmark and price like light across foil.

11. Glassmorphism Card with Gradient Text in Tailwind (opens in a new tab)

Published

Pure Tailwind
A frosted-glass article card floating over drifting colour orbs. Gradient text on glass is a contrast problem — whatever colour blurs through changes the background under every letter — so the headline uses high-lightness stops plus a soft drop-shadow, and the glass falls back to a denser fill via supports-[backdrop-filter:blur(1px)]: where blur isn't available.

12. Pastel Gradient Text in Tailwind CSS (opens in a new tab)

Published

Pure Tailwind
A slow-living blog layout in soft rose, sky and mint. Pastels on white are a contrast trap — the original's 60–90% lightness stops measured under 2:1 — so this port keeps the soft feel in the card washes (bg-ttg12-rose/12) and uses deeper, still-gentle oklch stops for the text itself.

13. Tailwind Vertical Gradient Text (Top to Bottom) (opens in a new tab)

Published

Pure Tailwind
Vertical gradients in two flavours: a dark rail of [writing-mode:vertical-rl] labels and two display words that fade top-to-bottom and bottom-to-top with bg-linear-to-b / bg-linear-to-t. The fade uses the opacity modifier on the end stop (to-ttg13-amber/20) so the hue survives as it dissolves.

14. Tailwind Radial Gradient Text Effect (opens in a new tab)

Published

Pure Tailwind
Text that glows from within: v4's bg-radial-[circle_at_50%_50%] puts the brightest stop at the centre of each word and fades to a deeper edge. Four variants show circle vs ellipse and centred vs off-centre focal points, plus a radial KPI number — the place radial text earns its keep.
Newsletter

Enjoying these demos? Get new ones by email.

A short email when a new collection ships. Unsubscribe any time.

at

Almost there: check your inbox to confirm.Manage

15. Tailwind Rainbow Gradient Text (Multi-Color) (opens in a new tab)

Published

Pure Tailwind
A full-spectrum rainbow from two colour stops. v4's /longer interpolation modifier tells the gradient to travel the long way round the oklch hue wheel, so from-ttg15-start to-ttg15-start sweeps all 360°. The animated twin loops seamlessly, and the tag cloud gets matching gradient borders.

16. Tailwind Gradient Text with Outline Stroke (opens in a new tab)

Published

Pure Tailwind
Stroke-only, fill-only and stroke-plus-fill side by side, plus a hollow display word whose outline fills with gradient on hover. Tailwind has no stroke-text utility, so [-webkit-text-stroke:2px_…] and [paint-order:stroke_fill] arbitrary properties do the work — right in the class list.

17. Tailwind Gradient Text Fallback with @supports (opens in a new tab)

Published

Pure Tailwind
A three-layer progressive-enhancement reference in pure utilities. Layer 1 is a solid colour every browser renders; layer 2 adds the gradient only inside supports-[background-clip:text]:; layer 3 shows the complete pattern with a not-supports-[…]: underline as a designed fallback — so no engine ever shows invisible text.

19. Tailwind Gradient Text on Multiline Paragraph (opens in a new tab)

Published

Pure Tailwind
How gradient text behaves when it wraps — demonstrated, not just described. An editorial article sets a multiline gradient headline and blockquote, then puts the two models side by side: one gradient across the whole block, versus box-decoration-clone giving every line its own full ramp.

20. Tailwind Dark Mode Gradient Text Toggle (opens in a new tab)

Published

Tailwind + JS
One card, two palettes: vivid neon gradients on dark, rich jewel tones on light. Because v4 utilities reference theme variables, the script just flips data-theme and a scoped rule re-points every --color-ttg20-* — headline, logo, chips and toggle all follow. It honours prefers-color-scheme on first load and remembers the choice.
FAQ

Frequently asked questions

How do I make gradient text in Tailwind CSS?
Gradient text uses three utilities working together. Apply a gradient background to the text element — in Tailwind v4 that's a direction utility like bg-linear-13 or bg-linear-120 plus colour stops such as from-indigo-500 via-fuchsia-500 to-rose-500. Then clip that background to the glyph shapes with bg-clip-text, and finally make the actual letters see-through with text-transparent so the clipped gradient shows through. Skip either of the last two and you get a solid-colour block or plain text. The hero heading (demo 01) applies all three to one line of an <h1>, which keeps the heading a real, selectable, indexable <h1> rather than an image. Because everything is a utility on the element itself, there is no wrapper markup and no custom CSS — the gradient paints only the text it is clipped to.
Why is my gradient text showing as invisible, black, or a solid colour?
The usual culprit is a missing or out-of-order utility. bg-clip-text with no text-transparent leaves the solid text colour painted on top of the clipped gradient, so you see the colour, not the gradient; text-transparent with no bg-clip-text clips nothing, so the text vanishes into the element background. You need both. A second cause is the gradient itself being empty: a direction utility like bg-linear-120 with no from-*/to-* stops produces a transparent background, which clips to transparent text — invisible. The third is browser support: if background-clip: text is unsupported the letters fall back to transparent and disappear. Demo 17 guards against exactly this with an @supports layer that keeps a solid colour until clip-text is known to work.
How do I animate a moving gradient across text in Tailwind?
Animating the hue flow means moving the gradient, not the text. Demo 08 makes the background a repeating tile roughly twice the text width — a bg-[length:...] sizing paired with repeating stops — then animates background-position from one tile edge to the next in a keyframe loop. Because the tile repeats seamlessly, the position can reset with no visible jump, giving a continuous flow through the word. The letters stay text-transparent and bg-clip-text throughout; only the background slides. Keep the loop on background-position rather than animating the colour stops, which cannot be interpolated. Add a motion-reduce:animate-none variant so the animation stops for users who ask for reduced motion — a looping colour shift is exactly the kind of continuous movement that variant exists to silence.
Is gradient text accessible to screen readers and low-vision users?
The text stays fully accessible to screen readers because it is still real text in the DOM — text-transparent only affects the visual fill, not the accessibility tree, so the word is announced and selected normally. The real risk is visual contrast for sighted users with low vision: a gradient means the contrast ratio changes letter to letter, and the lightest stop may fail against the background even if the darkest passes. Check the weakest stop, not the average. Demos 11 and 12 are built around this — gradient text on frosted glass and pale pastels on white are both contrast traps, so they keep stops dark enough to stay legible. For the decorative glow in demo 02, the blurred duplicate heading behind the real one is marked aria-hidden so it is not announced twice.
How do I add a fallback for browsers that don't support bg-clip-text?
Demo 17 is a three-layer progressive-enhancement reference built entirely from utilities. Layer one is a plain text-* colour every browser renders — the guaranteed-readable baseline. Layer two adds the gradient plus bg-clip-text and text-transparent inside an @supports (background-clip: text) query (and the -webkit- prefixed form), so the see-through letters only activate where the clip is actually supported. If support is missing, the element never becomes transparent and the solid colour from layer one stays visible instead of vanishing. This ordering matters: declaring text-transparent unconditionally is what causes the invisible-text bug on unsupporting engines. Wrapping the transparency behind the feature query is the safe pattern for any gradient text you ship to a broad audience.
Why does the gradient restart or look muddy when my text wraps to multiple lines?
When gradient text wraps, the gradient is clipped to the element's full box, not to each line — so across a multi-line <p> the colours run continuously top-to-bottom through the whole block, and any single line shows only the slice of the gradient that falls across it. That often reads as muddy, because no one line sees the full sweep. Demo 19 shows this directly on a wrapped editorial paragraph rather than just describing it. The fix depends on intent: use a near-vertical or multi-stop gradient so each line still gets varied colour, keep gradient text to one or two lines for headings, and leave long body copy a solid colour. A horizontal bg-linear-90 on a three-line paragraph is the worst case — each line gets almost the same narrow colour band.
How do I make a rainbow or radial gradient on text with Tailwind v4?
Two demos cover the less obvious gradient shapes. For a full rainbow from only two stops (demo 15), use v4's interpolation modifier — bg-linear-90/longer tells the gradient to travel the longer way around the colour wheel in OKLCH space, so near-identical endpoints sweep through every hue instead of a flat band. For a glow-from-within look (demo 14), use bg-radial-[circle_at_50%_50%] so the brightest stop sits at the centre of the text and darkens outward, rather than the left-to-right flow of a linear gradient. Both still rely on the same bg-clip-text and text-transparent pair; only the gradient utility changes. The /longer modifier and bg-radial-* are v4-specific, so check the cheat sheet in demo 18 for the v3 equivalents before porting older code.
When should I avoid gradient text?
Reach for a solid colour instead of a gradient when legibility or scale is at stake. Long body paragraphs are the clearest no — the multi-line clipping problem (demo 19) muddies the sweep, and a gradient makes dense text slower to read for everyone. Small UI text like captions, labels and fine print loses the gradient to its own size and only risks contrast, so demo 07's active nav link tints a pill and keeps the gradient as an accent rather than painting tiny letters. Avoid it anywhere the lightest stop can't clear a contrast threshold against the background, which is why the glass and pastel demos (11, 12) tune their stops carefully rather than using any palette. Good fits are the opposite: large, short, high-impact type — hero headings, logos, a single emphasised word — where the letters are big enough to show the full gradient and brief enough to stay readable.

Related collections

20 CSS Animated Buttons preview

20 CSS Animated Buttons

20 hand-coded CSS animated buttons — neon glow, ripple, 3D press, liquid fill, jelly bounce, shine sweep, animated border, moving gradient CTA, text flip, submit success state, add-to-cart progress, download icon, hamburger-to-close, toggle switch, loading spinner inside button, next/prev arrow nav, and ghost button background reveal. Half pure CSS, half lightweight JS for production interactions.

11 CSS animation-timeline Demos preview

11 CSS animation-timeline Demos

11 pure CSS animation-timeline demos built on the W3C scroll() and view() spec — reading progress bar, view-timeline fade & reveal, shrinking sticky header, stacking cards, horizontal scroll section, parallax hero, container shadow indicators, reverse-scroll columns, text scrim reveal, cover card to sticky header, and image zoom / clip-path wipe. Zero JS, off the main thread, Core Web Vitals safe. Copy-paste ready.

25 CSS Background Animations preview

25 CSS Background Animations

25 hand-coded CSS background animations for SaaS hero sections, developer tool documentation, agency portfolios, gaming and Web3 landing pages, seasonal e-commerce campaigns, and dark-mode dashboards. Covers full-screen gradient shifts, animated mesh gradients, aurora borealis glow, cursor spotlight follow, interactive water ripples, dot grid and diagonal stripe patterns, SVG grain and noise texture overlays, topographic contour lines, layered SVG waves, plasma and lava lamp fluids, bokeh light blur, particle constellation networks, matrix digital rain, synthwave 3D perspective grids, starfield warp speed, CRT scanline overlays, fog and mist drift, morphing organic blobs, floating glassmorphism orbs, halftone dot patterns, starry night skies, floating geometric shapes, rising bubbles, and falling snow. 20 are pure CSS with zero JavaScript; the 5 that need it use vanilla canvas or pointer tracking with no dependencies. Every background animates compositor-only properties so it never blocks the main thread, is scoped under a .bga-NN prefix for no-collision pasting, guards prefers-reduced-motion, and ports unchanged to React, Vue, Svelte, Astro, Next.js and Tailwind.

Search CodeFronts

Loading…