32 Tailwind CSS Tabs
19 / 32
Pure TailwindMIT licensed

Drop Cap Initial Letter Tabs in Tailwind CSS

Inactive tabs are single serif initials; the chosen one tips its capital into a terracotta drop cap (rotate −4°, scale 1.15 from the baseline) and unfolds the rest of the word in italic. Set in Fraunces, whose 900 cut and soft italic give the woodblock-and-ink contrast the idea needs.

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="ttb-19 group/tabs grid min-h-svh w-full place-items-center bg-ttb19-bg px-5 py-14 font-ttb19-serif text-ttb19-teal" aria-label="Drop cap initial letter tabs demo">
  <div class="grid w-full max-w-xl justify-items-center gap-7">
    <div class="w-full rounded-2xl bg-ttb19-paper p-7 shadow-[0_18px_40px_-24px_rgb(12_85_96/0.4)] ring-1 ring-ttb19-teal/12">
      <div role="radiogroup" aria-label="Section" class="flex items-baseline gap-7 border-b border-ttb19-teal/20 pb-4">
        <label class="group/tab flex min-h-11 cursor-pointer items-baseline text-ttb19-dim transition-colors hover:text-ttb19-teal has-checked:text-ttb19-teal has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb19-cap"><input class="sr-only" type="radio" name="ttb19" id="ttb19-r1" checked><span class="sr-only">Article</span><span aria-hidden="true" class="inline-block origin-bottom text-[30px] leading-none font-black transition-[rotate,scale,color] duration-500 ease-[cubic-bezier(0.34,1.56,0.64,1)] group-has-checked/tab:-rotate-4 group-has-checked/tab:scale-115 group-has-checked/tab:text-ttb19-cap motion-reduce:transition-none">A</span><span aria-hidden="true" class="ml-px max-w-0 overflow-hidden text-[19px] whitespace-nowrap italic transition-[max-width] delay-100 duration-500 ease-[cubic-bezier(0.65,0,0.35,1)] group-has-checked/tab:max-w-[8ch] motion-reduce:transition-none">rticle</span></label>
        <label class="group/tab flex min-h-11 cursor-pointer items-baseline text-ttb19-dim transition-colors hover:text-ttb19-teal has-checked:text-ttb19-teal has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb19-cap"><input class="sr-only" type="radio" name="ttb19" id="ttb19-r2"><span class="sr-only">Gallery</span><span aria-hidden="true" class="inline-block origin-bottom text-[30px] leading-none font-black transition-[rotate,scale,color] duration-500 ease-[cubic-bezier(0.34,1.56,0.64,1)] group-has-checked/tab:-rotate-4 group-has-checked/tab:scale-115 group-has-checked/tab:text-ttb19-cap motion-reduce:transition-none">G</span><span aria-hidden="true" class="ml-px max-w-0 overflow-hidden text-[19px] whitespace-nowrap italic transition-[max-width] delay-100 duration-500 ease-[cubic-bezier(0.65,0,0.35,1)] group-has-checked/tab:max-w-[8ch] motion-reduce:transition-none">allery</span></label>
        <label class="group/tab flex min-h-11 cursor-pointer items-baseline text-ttb19-dim transition-colors hover:text-ttb19-teal has-checked:text-ttb19-teal has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb19-cap"><input class="sr-only" type="radio" name="ttb19" id="ttb19-r3"><span class="sr-only">Notes</span><span aria-hidden="true" class="inline-block origin-bottom text-[30px] leading-none font-black transition-[rotate,scale,color] duration-500 ease-[cubic-bezier(0.34,1.56,0.64,1)] group-has-checked/tab:-rotate-4 group-has-checked/tab:scale-115 group-has-checked/tab:text-ttb19-cap motion-reduce:transition-none">N</span><span aria-hidden="true" class="ml-px max-w-0 overflow-hidden text-[19px] whitespace-nowrap italic transition-[max-width] delay-100 duration-500 ease-[cubic-bezier(0.65,0,0.35,1)] group-has-checked/tab:max-w-[8ch] motion-reduce:transition-none">otes</span></label>
      </div>
      <div class="pt-4 text-[16px] leading-relaxed text-ttb19-ash italic">
        <p class="hidden group-has-[#ttb19-r1:checked]/tabs:block">The body copy of an editorial feature, set long and generously leaded.</p>
        <p class="hidden group-has-[#ttb19-r2:checked]/tabs:block">A curated set of plates and engravings, each with a full caption.</p>
        <p class="hidden group-has-[#ttb19-r3:checked]/tabs:block">Marginalia and footnote annotations gathered from the margins.</p>
      </div>
    </div>
    <p aria-hidden="true" class="rounded-full border border-ttb19-teal/15 bg-ttb19-paper/60 px-3.5 py-2 font-ttb19-mono text-[11.5px] text-ttb19-ash">origin-bottom -rotate-4 scale-115 · tail max-w-0 → 8ch</p>
  </div>
</section>
@import "tailwindcss";

@theme {
  --color-ttb19-bg: #e8dec8;
  --color-ttb19-bg: oklch(0.903 0.031 86.5);
  --color-ttb19-paper: #f6f0e2;
  --color-ttb19-paper: oklch(0.956 0.020 87.5);
  --color-ttb19-teal: #0c5560;
  --color-ttb19-teal: oklch(0.414 0.068 210.7);
  --color-ttb19-dim: #4f7c83;
  --color-ttb19-dim: oklch(0.556 0.050 208.2);
  --color-ttb19-cap: #c4441f;
  --color-ttb19-cap: oklch(0.561 0.171 36.1);
  --color-ttb19-ash: #3a3a42;
  --color-ttb19-ash: oklch(0.352 0.014 285.7);
  --font-ttb19-serif: 'Fraunces', Georgia, serif;
  --font-ttb19-mono: 'JetBrains Mono', ui-monospace, monospace;
}
/* Root rule: the full-bleed contract, stated in CSS as well as in the markup's utilities, so the
   stage is sized before the browser build compiles. */

.ttb-19 {
  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-ttb19-bg: #e8dec8;
  --color-ttb19-bg: oklch(0.903 0.031 86.5);
  --color-ttb19-paper: #f6f0e2;
  --color-ttb19-paper: oklch(0.956 0.020 87.5);
  --color-ttb19-teal: #0c5560;
  --color-ttb19-teal: oklch(0.414 0.068 210.7);
  --color-ttb19-dim: #4f7c83;
  --color-ttb19-dim: oklch(0.556 0.050 208.2);
  --color-ttb19-cap: #c4441f;
  --color-ttb19-cap: oklch(0.561 0.171 36.1);
  --color-ttb19-ash: #3a3a42;
  --color-ttb19-ash: oklch(0.352 0.014 285.7);
  --font-ttb19-serif: 'Fraunces', Georgia, serif;
  --font-ttb19-mono: 'JetBrains Mono', ui-monospace, monospace;
}
/* Root rule: the full-bleed contract, stated in CSS as well as in the markup's utilities, so the
   stage is sized before the browser build compiles. */

.ttb-19 {
  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=Fraunces:ital,opsz,wght@0,9..144,400..900;1,9..144,400..700&family=JetBrains+Mono:wght@400;500&display=swap">

What changed in the port

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

  • transform: rotate(-4deg) scale(1.15) became -rotate-4 scale-115 — v4 writes the standalone rotate and scale properties, so the transition list names them.
  • The tail's max-width:0 → 200px became max-w-0 → max-w-[8ch], a cap sized to the words so the ease isn't spent on empty space.
  • UI upgrade from the CSS original: screen readers announced "A, rticle"; each radio is now named by an sr-only whole word with the split glyphs aria-hidden.
  • UI upgrade: inactive initials moved from 40% opacity (≈2.5:1) to a 4.6:1 teal; Fraunces replaces generic ui-serif, and the tabs sit on a paper card.
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: Drop Cap Initial Letter Tabs in Tailwind CSS
Source: https://codefronts.com/navigation/tailwind-css-tabs/drop-cap-initial-letter-tabs-tailwind-css/

Inactive tabs are single serif initials; the chosen one tips its capital into a terracotta drop cap (rotate −4°, scale 1.15 from the baseline) and unfolds the rest of the word in italic. Set in Fraunces, whose 900 cut and soft italic give the woodblock-and-ink contrast the idea needs.
## HTML
```html
<section class="ttb-19 group/tabs grid min-h-svh w-full place-items-center bg-ttb19-bg px-5 py-14 font-ttb19-serif text-ttb19-teal" aria-label="Drop cap initial letter tabs demo">
  <div class="grid w-full max-w-xl justify-items-center gap-7">
    <div class="w-full rounded-2xl bg-ttb19-paper p-7 shadow-[0_18px_40px_-24px_rgb(12_85_96/0.4)] ring-1 ring-ttb19-teal/12">
      <div role="radiogroup" aria-label="Section" class="flex items-baseline gap-7 border-b border-ttb19-teal/20 pb-4">
        <label class="group/tab flex min-h-11 cursor-pointer items-baseline text-ttb19-dim transition-colors hover:text-ttb19-teal has-checked:text-ttb19-teal has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb19-cap"><input class="sr-only" type="radio" name="ttb19" id="ttb19-r1" checked><span class="sr-only">Article</span><span aria-hidden="true" class="inline-block origin-bottom text-[30px] leading-none font-black transition-[rotate,scale,color] duration-500 ease-[cubic-bezier(0.34,1.56,0.64,1)] group-has-checked/tab:-rotate-4 group-has-checked/tab:scale-115 group-has-checked/tab:text-ttb19-cap motion-reduce:transition-none">A</span><span aria-hidden="true" class="ml-px max-w-0 overflow-hidden text-[19px] whitespace-nowrap italic transition-[max-width] delay-100 duration-500 ease-[cubic-bezier(0.65,0,0.35,1)] group-has-checked/tab:max-w-[8ch] motion-reduce:transition-none">rticle</span></label>
        <label class="group/tab flex min-h-11 cursor-pointer items-baseline text-ttb19-dim transition-colors hover:text-ttb19-teal has-checked:text-ttb19-teal has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb19-cap"><input class="sr-only" type="radio" name="ttb19" id="ttb19-r2"><span class="sr-only">Gallery</span><span aria-hidden="true" class="inline-block origin-bottom text-[30px] leading-none font-black transition-[rotate,scale,color] duration-500 ease-[cubic-bezier(0.34,1.56,0.64,1)] group-has-checked/tab:-rotate-4 group-has-checked/tab:scale-115 group-has-checked/tab:text-ttb19-cap motion-reduce:transition-none">G</span><span aria-hidden="true" class="ml-px max-w-0 overflow-hidden text-[19px] whitespace-nowrap italic transition-[max-width] delay-100 duration-500 ease-[cubic-bezier(0.65,0,0.35,1)] group-has-checked/tab:max-w-[8ch] motion-reduce:transition-none">allery</span></label>
        <label class="group/tab flex min-h-11 cursor-pointer items-baseline text-ttb19-dim transition-colors hover:text-ttb19-teal has-checked:text-ttb19-teal has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb19-cap"><input class="sr-only" type="radio" name="ttb19" id="ttb19-r3"><span class="sr-only">Notes</span><span aria-hidden="true" class="inline-block origin-bottom text-[30px] leading-none font-black transition-[rotate,scale,color] duration-500 ease-[cubic-bezier(0.34,1.56,0.64,1)] group-has-checked/tab:-rotate-4 group-has-checked/tab:scale-115 group-has-checked/tab:text-ttb19-cap motion-reduce:transition-none">N</span><span aria-hidden="true" class="ml-px max-w-0 overflow-hidden text-[19px] whitespace-nowrap italic transition-[max-width] delay-100 duration-500 ease-[cubic-bezier(0.65,0,0.35,1)] group-has-checked/tab:max-w-[8ch] motion-reduce:transition-none">otes</span></label>
      </div>
      <div class="pt-4 text-[16px] leading-relaxed text-ttb19-ash italic">
        <p class="hidden group-has-[#ttb19-r1:checked]/tabs:block">The body copy of an editorial feature, set long and generously leaded.</p>
        <p class="hidden group-has-[#ttb19-r2:checked]/tabs:block">A curated set of plates and engravings, each with a full caption.</p>
        <p class="hidden group-has-[#ttb19-r3:checked]/tabs:block">Marginalia and footnote annotations gathered from the margins.</p>
      </div>
    </div>
    <p aria-hidden="true" class="rounded-full border border-ttb19-teal/15 bg-ttb19-paper/60 px-3.5 py-2 font-ttb19-mono text-[11.5px] text-ttb19-ash">origin-bottom -rotate-4 scale-115 · tail max-w-0 → 8ch</p>
  </div>
</section>
```
## CSS
```css
@import "tailwindcss";

@theme {
  --color-ttb19-bg: #e8dec8;
  --color-ttb19-bg: oklch(0.903 0.031 86.5);
  --color-ttb19-paper: #f6f0e2;
  --color-ttb19-paper: oklch(0.956 0.020 87.5);
  --color-ttb19-teal: #0c5560;
  --color-ttb19-teal: oklch(0.414 0.068 210.7);
  --color-ttb19-dim: #4f7c83;
  --color-ttb19-dim: oklch(0.556 0.050 208.2);
  --color-ttb19-cap: #c4441f;
  --color-ttb19-cap: oklch(0.561 0.171 36.1);
  --color-ttb19-ash: #3a3a42;
  --color-ttb19-ash: oklch(0.352 0.014 285.7);
  --font-ttb19-serif: 'Fraunces', Georgia, serif;
  --font-ttb19-mono: 'JetBrains Mono', ui-monospace, monospace;
}
/* Root rule: the full-bleed contract, stated in CSS as well as in the markup's utilities, so the
   stage is sized before the browser build compiles. */

.ttb-19 {
  width: 100%;
  min-height: 100svh;
}
```

How this works

Two beats. The cap commits first with an overshoot ease; the tail waits 100ms, then opens:

<span class="origin-bottom transition-[rotate,scale,color] ease-[cubic-bezier(0.34,1.56,0.64,1)]
  group-has-checked/tab:-rotate-4 group-has-checked/tab:scale-115">A</span>
<span class="max-w-0 overflow-hidden italic transition-[max-width] delay-100
  group-has-checked/tab:max-w-[8ch]">rticle</span>

A word, not two fragments. Screen readers would otherwise read "A rticle". The visible pieces are aria-hidden and an sr-only copy of the whole word names the radio.

Make it yours

  • Bolder tip: -rotate-8 with scale-110.
  • Ochre caps: --color-ttb19-cap: #b9771e.
  • Longer words: raise max-w-[8ch] to fit.

Gotchas — read before shipping

  • max-w in ch is measured in the italic's own font; test your longest word.
  • Rotated caps need gap between tabs or they overlap neighbours.
  • Fraunces is variable with a SOFT axis; the default instance is used here.

Browser support

ChromeSafariFirefoxEdge
111+16.4+128+111+

Standalone rotate/scale are inside Tailwind v4's floor.

Techniques used in this demo

Utilitiesfirst-class utility or variant

Search CodeFronts

Loading…