Pure TailwindMIT licensed

Tailwind Radial Gradient Text Effect

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.

Live Demo
Plain CSSTailwind v4
Try it

Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time

Untitled UI React · Affiliate link

Get Untitled UI Pro

The code

<section class="ttg-14 w-full min-h-svh grid place-items-center bg-ttg14-bg bg-[radial-gradient(50%_40%_at_50%_30%,var(--color-ttg14-glow),transparent)] px-5 py-16 font-ttg14-sans text-ttg14-ink" aria-label="Radial gradient text demo">
  <div class="grid w-full max-w-2xl justify-items-center text-center">
    <h1 class="w-fit bg-radial-[circle_at_50%_50%] from-ttg14-amber-c to-ttg14-amber-e to-65% bg-clip-text font-ttg14-display text-[clamp(3.5rem,13vw,7rem)] leading-none font-black tracking-[-0.05em] text-transparent">Radiate</h1>
    <p class="mt-2 w-fit bg-radial-[ellipse_at_35%_60%] from-ttg14-violet-c to-ttg14-violet-e to-75% bg-clip-text font-ttg14-display text-[clamp(1.4rem,4.6vw,2.6rem)] font-bold tracking-[-0.03em] text-transparent">energy outward</p>
    <div class="mt-10 grid w-full gap-4 text-left sm:grid-cols-3">
      <article class="rounded-2xl border border-white/8 bg-white/[0.03] p-5"><h3 class="w-fit bg-radial-[circle_at_50%_40%] from-ttg14-sky-c to-ttg14-sky-e to-80% bg-clip-text font-ttg14-display text-2xl font-extrabold text-transparent">Expand</h3><p class="mt-2 text-[13.5px]/[1.6] text-ttg14-mut">Radial gradients grow from a central point, so text feels lit from within.</p></article>
      <article class="rounded-2xl border border-white/8 bg-white/[0.03] p-5"><h3 class="w-fit bg-radial-[circle_at_50%_40%] from-ttg14-pink-c to-ttg14-pink-e to-80% bg-clip-text font-ttg14-display text-2xl font-extrabold text-transparent">Focus</h3><p class="mt-2 text-[13.5px]/[1.6] text-ttg14-mut">A deeper perimeter draws the eye to the bright centre of the letterforms.</p></article>
      <article class="flex flex-col-reverse justify-end gap-1 rounded-2xl border border-white/8 bg-white/[0.03] p-5"><p class="text-[13.5px] text-ttg14-mut">Weekly active users</p><p class="w-fit bg-radial-[circle_at_50%_45%] from-ttg14-amber-c to-ttg14-amber-e to-70% bg-clip-text font-ttg14-display text-[2.6rem] leading-none font-black tracking-tight text-transparent tabular-nums">48.2K</p></article>
    </div>
    <code class="mt-8 rounded-lg border border-white/10 bg-white/[0.04] px-3 py-1.5 font-ttg14-mono text-[12px] text-ttg14-violet-c">bg-radial-[circle_at_50%_50%] from-… to-… to-65%</code>
  </div>
</section>
@import "tailwindcss";

@theme {
  --color-ttg14-bg: #09080f;
  --color-ttg14-bg: oklch(0.14 0.012 290);
  --color-ttg14-glow: #2a1d4a80;
  --color-ttg14-glow: oklch(0.26 0.07 295 / 0.5);
  --color-ttg14-ink: #eceaf3;
  --color-ttg14-ink: oklch(0.94 0.008 290);
  --color-ttg14-mut: #a6a3b5;
  --color-ttg14-mut: oklch(0.74 0.02 290);
  --color-ttg14-amber-c: #fff1b8;
  --color-ttg14-amber-c: oklch(0.96 0.08 95);
  --color-ttg14-amber-e: #f08a0b;
  --color-ttg14-amber-e: oklch(0.72 0.17 60);
  --color-ttg14-violet-c: #d9ccff;
  --color-ttg14-violet-c: oklch(0.87 0.07 295);
  --color-ttg14-violet-e: #7c3aed;
  --color-ttg14-violet-e: oklch(0.54 0.25 293);
  --color-ttg14-sky-c: #c9eeff;
  --color-ttg14-sky-c: oklch(0.93 0.05 225);
  --color-ttg14-sky-e: #2563eb;
  --color-ttg14-sky-e: oklch(0.55 0.22 263);
  --color-ttg14-pink-c: #ffd6ec;
  --color-ttg14-pink-c: oklch(0.91 0.06 350);
  --color-ttg14-pink-e: #d61f7c;
  --color-ttg14-pink-e: oklch(0.58 0.22 355);
  --font-ttg14-display: 'Unbounded', system-ui, sans-serif;
  --font-ttg14-sans: 'Geist', system-ui, sans-serif;
  --font-ttg14-mono: 'Geist Mono', ui-monospace, monospace;
}

.ttg-14 {
  width: 100%;
  min-height: 100svh;
}

Setup — do this once per project

Skip this if your project already runs Tailwind v4.

1Load Tailwind
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

Compiles in the browser — perfect for a CodePen or a quick test, not for production.

2Add the stylesheetRequiredthe @theme block is what makes the custom utilities exist
@import "tailwindcss";

@theme {
  --color-ttg14-bg: #09080f;
  --color-ttg14-bg: oklch(0.14 0.012 290);
  --color-ttg14-glow: #2a1d4a80;
  --color-ttg14-glow: oklch(0.26 0.07 295 / 0.5);
  --color-ttg14-ink: #eceaf3;
  --color-ttg14-ink: oklch(0.94 0.008 290);
  --color-ttg14-mut: #a6a3b5;
  --color-ttg14-mut: oklch(0.74 0.02 290);
  --color-ttg14-amber-c: #fff1b8;
  --color-ttg14-amber-c: oklch(0.96 0.08 95);
  --color-ttg14-amber-e: #f08a0b;
  --color-ttg14-amber-e: oklch(0.72 0.17 60);
  --color-ttg14-violet-c: #d9ccff;
  --color-ttg14-violet-c: oklch(0.87 0.07 295);
  --color-ttg14-violet-e: #7c3aed;
  --color-ttg14-violet-e: oklch(0.54 0.25 293);
  --color-ttg14-sky-c: #c9eeff;
  --color-ttg14-sky-c: oklch(0.93 0.05 225);
  --color-ttg14-sky-e: #2563eb;
  --color-ttg14-sky-e: oklch(0.55 0.22 263);
  --color-ttg14-pink-c: #ffd6ec;
  --color-ttg14-pink-c: oklch(0.91 0.06 350);
  --color-ttg14-pink-e: #d61f7c;
  --color-ttg14-pink-e: oklch(0.58 0.22 355);
  --font-ttg14-display: 'Unbounded', system-ui, sans-serif;
  --font-ttg14-sans: 'Geist', system-ui, sans-serif;
  --font-ttg14-mono: 'Geist Mono', ui-monospace, monospace;
}

.ttg-14 {
  width: 100%;
  min-height: 100svh;
}
3Fonts used by this demooptional — skip if you have your own type stack
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Unbounded:wght@500..900&family=Geist:wght@400..600&family=Geist+Mono:wght@500&display=swap">

What changed in the port

Which parts became utilities, which stayed CSS, and why.

  • Four .tg-14__radial-* rules became bg-radial-[…] utilities with stop positions — the shape, focus and spread are all readable in the markup.
  • Bug fix: the original applied radial gradients to block headings, so the glow centred on the row instead of the word; w-fit re-centres it.
  • UI upgrade: a third card shows a radial KPI number (the strongest real-world use), Unbounded gives the round display type the glow suits, and muted copy rose from 3.6:1 to 7.6:1.
Paste this into ChatGPT, Claude, Cursor, or any coding assistant. The block below is pre-framed with everything the AI needs to integrate this demo into your project — markup, styles, scoping notes, and the source URL. Hit Copy and paste straight into your chat.
Here's a working CSS demo from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Tailwind Radial Gradient Text Effect
Source: https://codefronts.com/motion/tailwind-css-text-gradient/tailwind-radial-gradient-text-effect/

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 &mdash; the place radial text earns its keep.
## HTML
```html
<section class="ttg-14 w-full min-h-svh grid place-items-center bg-ttg14-bg bg-[radial-gradient(50%_40%_at_50%_30%,var(--color-ttg14-glow),transparent)] px-5 py-16 font-ttg14-sans text-ttg14-ink" aria-label="Radial gradient text demo">
  <div class="grid w-full max-w-2xl justify-items-center text-center">
    <h1 class="w-fit bg-radial-[circle_at_50%_50%] from-ttg14-amber-c to-ttg14-amber-e to-65% bg-clip-text font-ttg14-display text-[clamp(3.5rem,13vw,7rem)] leading-none font-black tracking-[-0.05em] text-transparent">Radiate</h1>
    <p class="mt-2 w-fit bg-radial-[ellipse_at_35%_60%] from-ttg14-violet-c to-ttg14-violet-e to-75% bg-clip-text font-ttg14-display text-[clamp(1.4rem,4.6vw,2.6rem)] font-bold tracking-[-0.03em] text-transparent">energy outward</p>
    <div class="mt-10 grid w-full gap-4 text-left sm:grid-cols-3">
      <article class="rounded-2xl border border-white/8 bg-white/[0.03] p-5"><h3 class="w-fit bg-radial-[circle_at_50%_40%] from-ttg14-sky-c to-ttg14-sky-e to-80% bg-clip-text font-ttg14-display text-2xl font-extrabold text-transparent">Expand</h3><p class="mt-2 text-[13.5px]/[1.6] text-ttg14-mut">Radial gradients grow from a central point, so text feels lit from within.</p></article>
      <article class="rounded-2xl border border-white/8 bg-white/[0.03] p-5"><h3 class="w-fit bg-radial-[circle_at_50%_40%] from-ttg14-pink-c to-ttg14-pink-e to-80% bg-clip-text font-ttg14-display text-2xl font-extrabold text-transparent">Focus</h3><p class="mt-2 text-[13.5px]/[1.6] text-ttg14-mut">A deeper perimeter draws the eye to the bright centre of the letterforms.</p></article>
      <article class="flex flex-col-reverse justify-end gap-1 rounded-2xl border border-white/8 bg-white/[0.03] p-5"><p class="text-[13.5px] text-ttg14-mut">Weekly active users</p><p class="w-fit bg-radial-[circle_at_50%_45%] from-ttg14-amber-c to-ttg14-amber-e to-70% bg-clip-text font-ttg14-display text-[2.6rem] leading-none font-black tracking-tight text-transparent tabular-nums">48.2K</p></article>
    </div>
    <code class="mt-8 rounded-lg border border-white/10 bg-white/[0.04] px-3 py-1.5 font-ttg14-mono text-[12px] text-ttg14-violet-c">bg-radial-[circle_at_50%_50%] from-… to-… to-65%</code>
  </div>
</section>
```
## CSS
```css
@import "tailwindcss";

@theme {
  --color-ttg14-bg: #09080f;
  --color-ttg14-bg: oklch(0.14 0.012 290);
  --color-ttg14-glow: #2a1d4a80;
  --color-ttg14-glow: oklch(0.26 0.07 295 / 0.5);
  --color-ttg14-ink: #eceaf3;
  --color-ttg14-ink: oklch(0.94 0.008 290);
  --color-ttg14-mut: #a6a3b5;
  --color-ttg14-mut: oklch(0.74 0.02 290);
  --color-ttg14-amber-c: #fff1b8;
  --color-ttg14-amber-c: oklch(0.96 0.08 95);
  --color-ttg14-amber-e: #f08a0b;
  --color-ttg14-amber-e: oklch(0.72 0.17 60);
  --color-ttg14-violet-c: #d9ccff;
  --color-ttg14-violet-c: oklch(0.87 0.07 295);
  --color-ttg14-violet-e: #7c3aed;
  --color-ttg14-violet-e: oklch(0.54 0.25 293);
  --color-ttg14-sky-c: #c9eeff;
  --color-ttg14-sky-c: oklch(0.93 0.05 225);
  --color-ttg14-sky-e: #2563eb;
  --color-ttg14-sky-e: oklch(0.55 0.22 263);
  --color-ttg14-pink-c: #ffd6ec;
  --color-ttg14-pink-c: oklch(0.91 0.06 350);
  --color-ttg14-pink-e: #d61f7c;
  --color-ttg14-pink-e: oklch(0.58 0.22 355);
  --font-ttg14-display: 'Unbounded', system-ui, sans-serif;
  --font-ttg14-sans: 'Geist', system-ui, sans-serif;
  --font-ttg14-mono: 'Geist Mono', ui-monospace, monospace;
}

.ttg-14 {
  width: 100%;
  min-height: 100svh;
}
```

How this works

Radial in one utility. v4 adds bg-radial with an arbitrary shape/position slot and reuses the same stop utilities as linear gradients:

<h1 class="w-fit bg-radial-[circle_at_50%_50%] from-ttg14-amber-c to-ttg14-amber-e to-65%
  bg-clip-text text-transparent">Radiate</h1>

The centre is the box's centre. On a full-width heading the glow would sit in the middle of the row, not the word — w-fit keeps them aligned.

Spread is the end-stop position. to-65% reaches the edge colour sooner (tighter glow); to-90% lets the light bleed further out.

Make it yours

  • Side-lit: bg-radial-[circle_at_15%_50%].
  • Spotlight: make the edge stop near-black so long words fade into the stage.
  • Wide words: ellipse_70%_50%_at_50%_50% matches the aspect of long strings.
  • Pulse: add bg-[length:150%_150%] and animate the position between 40% and 60%.

Gotchas — read before shipping

  • Underscores become spaces inside bg-radial-[…] — write circle_at_50%_50%, never with real spaces.
  • A focal point outside the glyphs (e.g. at_5%_50%) can make the rest of the word read as a flat colour.
  • Radial stops are measured from the centre outward, so to-65% means 65% of the radius, not the width.

Browser support

ChromeSafariFirefoxEdge
111+16.4+128+111+

radial-gradient is universal; the floor is Tailwind v4's sheet.

Techniques used in this demo

Arbitraryneeds bracket syntax

Search CodeFronts

Loading…