19 / 32
All 32 in 32 Tailwind CSS Tabs
- 01Tailwind CSS Tabs with Sliding Underline Indicator
- 02Neon Glow Tailwind Tabs with Per-Tab Accent Colors
- 03Neo-Brutalist Tailwind Tabs with Press Effect
- 04Color-Coded Tailwind CSS Tabs Component
- 05VS Code Style File Tabs in Tailwind CSS
- 06iOS Segmented Control in Tailwind CSS
- 07Bento Grid Card Tabs in Tailwind CSS
- 08Vertical Tabs with Timeline Progress in Tailwind CSS
- 09Terminal Window Tabs in Tailwind CSS (Retro CRT)
- 10Expanding Icon Tabs in Tailwind CSS
- 11Typewriter Animation Tabs in Tailwind CSS
- 12Tailwind Tabs with Particle Burst Animation
- 13Animated Counter Tabs in Tailwind CSS (Type Specimen)
- 14Oversized Cropped Text Tabs in Tailwind CSS
- 15Tailwind Sidebar Navigation with Sliding Indicator
- 16Tailwind Bottom Navigation Bar with Expanding Labels
- 17Variable Font Weight Tabs in Tailwind CSS
- 18Uppercase Tabs with Thick Sliding Bar in Tailwind CSS
- 19Drop Cap Initial Letter Tabs in Tailwind CSS
- 20Industrial Stencil Tabs in Tailwind CSS
- 21Bracket Selection Tabs in Tailwind CSS
- 22Bauhaus Color Block Tabs in Tailwind CSS
- 23Inverted Rubber Stamp Tabs in Tailwind CSS
- 24Outlined Tabs with Corner Markers in Tailwind CSS
- 25Tailwind Pill Tab Bar with Icons
- 26Risograph Print Effect Tabs in Tailwind CSS
- 27Animated SVG Underline Tabs in Tailwind CSS
- 28Font Specimen Glyph Tabs in Tailwind CSS
- 29Sliding Pill Tabs with Icons in Tailwind CSS
- 30Folded Corner Tabs in Tailwind CSS (clip-path)
- 31Bookmark Ribbon Navigation in Tailwind CSS
- 32Neumorphic Inset Tabs in Tailwind CSS
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.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
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><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;
}@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.
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<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.
npm install tailwindcss @tailwindcss/vite
npm install tailwindcss @tailwindcss/vite// vite.config.js ("type": "module" in package.json)
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [tailwindcss()],
})// vite.config.js ("type": "module" in package.json)
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [tailwindcss()],
})Any v4 setup works — Vite, PostCSS or the CLI. Nothing in this demo is bundler-specific.
@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;
}@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;
}<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">
<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 standalonerotateandscaleproperties, so the transition list names them.- The tail's
max-width:0 → 200pxbecamemax-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-onlywhole word with the split glyphsaria-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.
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;
}
```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-8withscale-110. - Ochre caps:
--color-ttb19-cap: #b9771e. - Longer words: raise
max-w-[8ch]to fit.
Gotchas — read before shipping
max-winchis 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
SOFTaxis; the default instance is used here.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
Standalone rotate/scale are inside Tailwind v4's floor.