27 / 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
Animated SVG Underline Tabs in Tailwind CSS
Italic slab-serif tabs on cream vellum; the active word gets an emerald swash that draws itself beneath the letters like a calligrapher's flourish. The port normalises the path with pathLength="1", so the draw is exact for any curve, and sets the labels in Zilla Slab italic.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<section class="ttb-27 group/tabs grid min-h-svh w-full place-items-center bg-ttb27-bg px-5 py-14 font-ttb27-slab text-ttb27-ink" aria-label="Animated SVG underline tabs demo">
<div class="grid w-full max-w-xl justify-items-start gap-7">
<div role="radiogroup" aria-label="Section" class="flex flex-wrap items-end gap-x-9 gap-y-4">
<label class="group/tab relative min-h-11 cursor-pointer pb-2 text-[24px] font-bold text-ttb27-mut italic transition-colors hover:text-ttb27-ink has-checked:text-ttb27-ink has-focus-visible:outline-2 has-focus-visible:outline-offset-6 has-focus-visible:outline-ttb27-ink"><input class="sr-only" type="radio" name="ttb27" id="ttb27-r1" checked>Manifesto<svg aria-hidden="true" class="absolute -bottom-2 left-0 h-3.5 w-full overflow-visible" viewBox="0 0 100 14" preserveAspectRatio="none"><path pathLength="1" d="M2 9 Q 22 2 44 7 T 86 6 q 8-1 10 3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" class="transition-[stroke-dashoffset] duration-700 ease-[cubic-bezier(0.65,0,0.35,1)] [stroke-dasharray:1] [stroke-dashoffset:1] group-has-checked/tab:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></label>
<label class="group/tab relative min-h-11 cursor-pointer pb-2 text-[24px] font-bold text-ttb27-mut italic transition-colors hover:text-ttb27-ink has-checked:text-ttb27-ink has-focus-visible:outline-2 has-focus-visible:outline-offset-6 has-focus-visible:outline-ttb27-ink"><input class="sr-only" type="radio" name="ttb27" id="ttb27-r2">Colophon<svg aria-hidden="true" class="absolute -bottom-2 left-0 h-3.5 w-full overflow-visible" viewBox="0 0 100 14" preserveAspectRatio="none"><path pathLength="1" d="M2 9 Q 22 2 44 7 T 86 6 q 8-1 10 3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" class="transition-[stroke-dashoffset] duration-700 ease-[cubic-bezier(0.65,0,0.35,1)] [stroke-dasharray:1] [stroke-dashoffset:1] group-has-checked/tab:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></label>
<label class="group/tab relative min-h-11 cursor-pointer pb-2 text-[24px] font-bold text-ttb27-mut italic transition-colors hover:text-ttb27-ink has-checked:text-ttb27-ink has-focus-visible:outline-2 has-focus-visible:outline-offset-6 has-focus-visible:outline-ttb27-ink"><input class="sr-only" type="radio" name="ttb27" id="ttb27-r3">Errata<svg aria-hidden="true" class="absolute -bottom-2 left-0 h-3.5 w-full overflow-visible" viewBox="0 0 100 14" preserveAspectRatio="none"><path pathLength="1" d="M2 9 Q 22 2 44 7 T 86 6 q 8-1 10 3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" class="transition-[stroke-dashoffset] duration-700 ease-[cubic-bezier(0.65,0,0.35,1)] [stroke-dasharray:1] [stroke-dashoffset:1] group-has-checked/tab:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></label>
</div>
<div class="max-w-[40ch] pt-2 font-ttb27-serif text-[17px] leading-relaxed text-ttb27-ash italic">
<p class="hidden group-has-[#ttb27-r1:checked]/tabs:block">The founding statement of intent, set in full measure.</p>
<p class="hidden group-has-[#ttb27-r2:checked]/tabs:block">The closing inscription: type, paper and press notes.</p>
<p class="hidden group-has-[#ttb27-r3:checked]/tabs:block">Corrections issued after the first printing.</p>
</div>
<p aria-hidden="true" class="rounded-full border border-ttb27-ink/15 bg-white/50 px-3.5 py-2 font-ttb27-mono text-[11.5px] text-ttb27-ash">pathLength="1" · [stroke-dashoffset:1] → 0</p>
</div>
</section><section class="ttb-27 group/tabs grid min-h-svh w-full place-items-center bg-ttb27-bg px-5 py-14 font-ttb27-slab text-ttb27-ink" aria-label="Animated SVG underline tabs demo">
<div class="grid w-full max-w-xl justify-items-start gap-7">
<div role="radiogroup" aria-label="Section" class="flex flex-wrap items-end gap-x-9 gap-y-4">
<label class="group/tab relative min-h-11 cursor-pointer pb-2 text-[24px] font-bold text-ttb27-mut italic transition-colors hover:text-ttb27-ink has-checked:text-ttb27-ink has-focus-visible:outline-2 has-focus-visible:outline-offset-6 has-focus-visible:outline-ttb27-ink"><input class="sr-only" type="radio" name="ttb27" id="ttb27-r1" checked>Manifesto<svg aria-hidden="true" class="absolute -bottom-2 left-0 h-3.5 w-full overflow-visible" viewBox="0 0 100 14" preserveAspectRatio="none"><path pathLength="1" d="M2 9 Q 22 2 44 7 T 86 6 q 8-1 10 3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" class="transition-[stroke-dashoffset] duration-700 ease-[cubic-bezier(0.65,0,0.35,1)] [stroke-dasharray:1] [stroke-dashoffset:1] group-has-checked/tab:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></label>
<label class="group/tab relative min-h-11 cursor-pointer pb-2 text-[24px] font-bold text-ttb27-mut italic transition-colors hover:text-ttb27-ink has-checked:text-ttb27-ink has-focus-visible:outline-2 has-focus-visible:outline-offset-6 has-focus-visible:outline-ttb27-ink"><input class="sr-only" type="radio" name="ttb27" id="ttb27-r2">Colophon<svg aria-hidden="true" class="absolute -bottom-2 left-0 h-3.5 w-full overflow-visible" viewBox="0 0 100 14" preserveAspectRatio="none"><path pathLength="1" d="M2 9 Q 22 2 44 7 T 86 6 q 8-1 10 3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" class="transition-[stroke-dashoffset] duration-700 ease-[cubic-bezier(0.65,0,0.35,1)] [stroke-dasharray:1] [stroke-dashoffset:1] group-has-checked/tab:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></label>
<label class="group/tab relative min-h-11 cursor-pointer pb-2 text-[24px] font-bold text-ttb27-mut italic transition-colors hover:text-ttb27-ink has-checked:text-ttb27-ink has-focus-visible:outline-2 has-focus-visible:outline-offset-6 has-focus-visible:outline-ttb27-ink"><input class="sr-only" type="radio" name="ttb27" id="ttb27-r3">Errata<svg aria-hidden="true" class="absolute -bottom-2 left-0 h-3.5 w-full overflow-visible" viewBox="0 0 100 14" preserveAspectRatio="none"><path pathLength="1" d="M2 9 Q 22 2 44 7 T 86 6 q 8-1 10 3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" class="transition-[stroke-dashoffset] duration-700 ease-[cubic-bezier(0.65,0,0.35,1)] [stroke-dasharray:1] [stroke-dashoffset:1] group-has-checked/tab:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></label>
</div>
<div class="max-w-[40ch] pt-2 font-ttb27-serif text-[17px] leading-relaxed text-ttb27-ash italic">
<p class="hidden group-has-[#ttb27-r1:checked]/tabs:block">The founding statement of intent, set in full measure.</p>
<p class="hidden group-has-[#ttb27-r2:checked]/tabs:block">The closing inscription: type, paper and press notes.</p>
<p class="hidden group-has-[#ttb27-r3:checked]/tabs:block">Corrections issued after the first printing.</p>
</div>
<p aria-hidden="true" class="rounded-full border border-ttb27-ink/15 bg-white/50 px-3.5 py-2 font-ttb27-mono text-[11.5px] text-ttb27-ash">pathLength="1" · [stroke-dashoffset:1] → 0</p>
</div>
</section>@import "tailwindcss";
@theme {
--color-ttb27-bg: #fbf2d4;
--color-ttb27-bg: oklch(0.960 0.040 93.2);
--color-ttb27-ink: #0f4f3d;
--color-ttb27-ink: oklch(0.383 0.070 169.3);
--color-ttb27-mut: #4a7a6c;
--color-ttb27-mut: oklch(0.541 0.057 173.6);
--color-ttb27-ash: #3a3a42;
--color-ttb27-ash: oklch(0.352 0.014 285.7);
--font-ttb27-slab: 'Zilla Slab', Rockwell, serif;
--font-ttb27-serif: 'Newsreader', Georgia, serif;
--font-ttb27-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-27 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-ttb27-bg: #fbf2d4;
--color-ttb27-bg: oklch(0.960 0.040 93.2);
--color-ttb27-ink: #0f4f3d;
--color-ttb27-ink: oklch(0.383 0.070 169.3);
--color-ttb27-mut: #4a7a6c;
--color-ttb27-mut: oklch(0.541 0.057 173.6);
--color-ttb27-ash: #3a3a42;
--color-ttb27-ash: oklch(0.352 0.014 285.7);
--font-ttb27-slab: 'Zilla Slab', Rockwell, serif;
--font-ttb27-serif: 'Newsreader', Georgia, serif;
--font-ttb27-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-27 {
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-ttb27-bg: #fbf2d4;
--color-ttb27-bg: oklch(0.960 0.040 93.2);
--color-ttb27-ink: #0f4f3d;
--color-ttb27-ink: oklch(0.383 0.070 169.3);
--color-ttb27-mut: #4a7a6c;
--color-ttb27-mut: oklch(0.541 0.057 173.6);
--color-ttb27-ash: #3a3a42;
--color-ttb27-ash: oklch(0.352 0.014 285.7);
--font-ttb27-slab: 'Zilla Slab', Rockwell, serif;
--font-ttb27-serif: 'Newsreader', Georgia, serif;
--font-ttb27-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-27 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-ttb27-bg: #fbf2d4;
--color-ttb27-bg: oklch(0.960 0.040 93.2);
--color-ttb27-ink: #0f4f3d;
--color-ttb27-ink: oklch(0.383 0.070 169.3);
--color-ttb27-mut: #4a7a6c;
--color-ttb27-mut: oklch(0.541 0.057 173.6);
--color-ttb27-ash: #3a3a42;
--color-ttb27-ash: oklch(0.352 0.014 285.7);
--font-ttb27-slab: 'Zilla Slab', Rockwell, serif;
--font-ttb27-serif: 'Newsreader', Georgia, serif;
--font-ttb27-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-27 {
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=Zilla+Slab:ital,wght@0,500;1,500;1,700&family=Newsreader:ital,opsz,wght@1,6..72,400..600&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=Zilla+Slab:ital,wght@0,500;1,500;1,700&family=Newsreader:ital,opsz,wght@1,6..72,400..600&family=JetBrains+Mono:wght@400;500&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
stroke-dasharray:100; stroke-dashoffset:100becamepathLength="1"with[stroke-dasharray:1] [stroke-dashoffset:1]— exact for any curve.- The inline
stroke="#0f4f3d"becamestroke="currentColor", so the swash follows the label's colour token. - UI upgrade from the CSS original: labels are Zilla Slab italic — a real slab serif, matching the demo's name — at 24px, and the swash ends in a small Spencerian hook.
- UI upgrade: inactive labels moved from 55% emerald (≈4.0:1) to a 4.9:1 token, and a focus ring was added.
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: Animated SVG Underline Tabs in Tailwind CSS
Source: https://codefronts.com/navigation/tailwind-css-tabs/animated-svg-underline-tabs-tailwind-css/
Italic slab-serif tabs on cream vellum; the active word gets an emerald swash that draws itself beneath the letters like a calligrapher's flourish. The port normalises the path with pathLength="1", so the draw is exact for any curve, and sets the labels in Zilla Slab italic.
## HTML
```html
<section class="ttb-27 group/tabs grid min-h-svh w-full place-items-center bg-ttb27-bg px-5 py-14 font-ttb27-slab text-ttb27-ink" aria-label="Animated SVG underline tabs demo">
<div class="grid w-full max-w-xl justify-items-start gap-7">
<div role="radiogroup" aria-label="Section" class="flex flex-wrap items-end gap-x-9 gap-y-4">
<label class="group/tab relative min-h-11 cursor-pointer pb-2 text-[24px] font-bold text-ttb27-mut italic transition-colors hover:text-ttb27-ink has-checked:text-ttb27-ink has-focus-visible:outline-2 has-focus-visible:outline-offset-6 has-focus-visible:outline-ttb27-ink"><input class="sr-only" type="radio" name="ttb27" id="ttb27-r1" checked>Manifesto<svg aria-hidden="true" class="absolute -bottom-2 left-0 h-3.5 w-full overflow-visible" viewBox="0 0 100 14" preserveAspectRatio="none"><path pathLength="1" d="M2 9 Q 22 2 44 7 T 86 6 q 8-1 10 3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" class="transition-[stroke-dashoffset] duration-700 ease-[cubic-bezier(0.65,0,0.35,1)] [stroke-dasharray:1] [stroke-dashoffset:1] group-has-checked/tab:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></label>
<label class="group/tab relative min-h-11 cursor-pointer pb-2 text-[24px] font-bold text-ttb27-mut italic transition-colors hover:text-ttb27-ink has-checked:text-ttb27-ink has-focus-visible:outline-2 has-focus-visible:outline-offset-6 has-focus-visible:outline-ttb27-ink"><input class="sr-only" type="radio" name="ttb27" id="ttb27-r2">Colophon<svg aria-hidden="true" class="absolute -bottom-2 left-0 h-3.5 w-full overflow-visible" viewBox="0 0 100 14" preserveAspectRatio="none"><path pathLength="1" d="M2 9 Q 22 2 44 7 T 86 6 q 8-1 10 3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" class="transition-[stroke-dashoffset] duration-700 ease-[cubic-bezier(0.65,0,0.35,1)] [stroke-dasharray:1] [stroke-dashoffset:1] group-has-checked/tab:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></label>
<label class="group/tab relative min-h-11 cursor-pointer pb-2 text-[24px] font-bold text-ttb27-mut italic transition-colors hover:text-ttb27-ink has-checked:text-ttb27-ink has-focus-visible:outline-2 has-focus-visible:outline-offset-6 has-focus-visible:outline-ttb27-ink"><input class="sr-only" type="radio" name="ttb27" id="ttb27-r3">Errata<svg aria-hidden="true" class="absolute -bottom-2 left-0 h-3.5 w-full overflow-visible" viewBox="0 0 100 14" preserveAspectRatio="none"><path pathLength="1" d="M2 9 Q 22 2 44 7 T 86 6 q 8-1 10 3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" class="transition-[stroke-dashoffset] duration-700 ease-[cubic-bezier(0.65,0,0.35,1)] [stroke-dasharray:1] [stroke-dashoffset:1] group-has-checked/tab:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></label>
</div>
<div class="max-w-[40ch] pt-2 font-ttb27-serif text-[17px] leading-relaxed text-ttb27-ash italic">
<p class="hidden group-has-[#ttb27-r1:checked]/tabs:block">The founding statement of intent, set in full measure.</p>
<p class="hidden group-has-[#ttb27-r2:checked]/tabs:block">The closing inscription: type, paper and press notes.</p>
<p class="hidden group-has-[#ttb27-r3:checked]/tabs:block">Corrections issued after the first printing.</p>
</div>
<p aria-hidden="true" class="rounded-full border border-ttb27-ink/15 bg-white/50 px-3.5 py-2 font-ttb27-mono text-[11.5px] text-ttb27-ash">pathLength="1" · [stroke-dashoffset:1] → 0</p>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-ttb27-bg: #fbf2d4;
--color-ttb27-bg: oklch(0.960 0.040 93.2);
--color-ttb27-ink: #0f4f3d;
--color-ttb27-ink: oklch(0.383 0.070 169.3);
--color-ttb27-mut: #4a7a6c;
--color-ttb27-mut: oklch(0.541 0.057 173.6);
--color-ttb27-ash: #3a3a42;
--color-ttb27-ash: oklch(0.352 0.014 285.7);
--font-ttb27-slab: 'Zilla Slab', Rockwell, serif;
--font-ttb27-serif: 'Newsreader', Georgia, serif;
--font-ttb27-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-27 {
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: Animated SVG Underline Tabs in Tailwind CSS
Source: https://codefronts.com/navigation/tailwind-css-tabs/animated-svg-underline-tabs-tailwind-css/
Italic slab-serif tabs on cream vellum; the active word gets an emerald swash that draws itself beneath the letters like a calligrapher's flourish. The port normalises the path with pathLength="1", so the draw is exact for any curve, and sets the labels in Zilla Slab italic.
## HTML
```html
<section class="ttb-27 group/tabs grid min-h-svh w-full place-items-center bg-ttb27-bg px-5 py-14 font-ttb27-slab text-ttb27-ink" aria-label="Animated SVG underline tabs demo">
<div class="grid w-full max-w-xl justify-items-start gap-7">
<div role="radiogroup" aria-label="Section" class="flex flex-wrap items-end gap-x-9 gap-y-4">
<label class="group/tab relative min-h-11 cursor-pointer pb-2 text-[24px] font-bold text-ttb27-mut italic transition-colors hover:text-ttb27-ink has-checked:text-ttb27-ink has-focus-visible:outline-2 has-focus-visible:outline-offset-6 has-focus-visible:outline-ttb27-ink"><input class="sr-only" type="radio" name="ttb27" id="ttb27-r1" checked>Manifesto<svg aria-hidden="true" class="absolute -bottom-2 left-0 h-3.5 w-full overflow-visible" viewBox="0 0 100 14" preserveAspectRatio="none"><path pathLength="1" d="M2 9 Q 22 2 44 7 T 86 6 q 8-1 10 3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" class="transition-[stroke-dashoffset] duration-700 ease-[cubic-bezier(0.65,0,0.35,1)] [stroke-dasharray:1] [stroke-dashoffset:1] group-has-checked/tab:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></label>
<label class="group/tab relative min-h-11 cursor-pointer pb-2 text-[24px] font-bold text-ttb27-mut italic transition-colors hover:text-ttb27-ink has-checked:text-ttb27-ink has-focus-visible:outline-2 has-focus-visible:outline-offset-6 has-focus-visible:outline-ttb27-ink"><input class="sr-only" type="radio" name="ttb27" id="ttb27-r2">Colophon<svg aria-hidden="true" class="absolute -bottom-2 left-0 h-3.5 w-full overflow-visible" viewBox="0 0 100 14" preserveAspectRatio="none"><path pathLength="1" d="M2 9 Q 22 2 44 7 T 86 6 q 8-1 10 3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" class="transition-[stroke-dashoffset] duration-700 ease-[cubic-bezier(0.65,0,0.35,1)] [stroke-dasharray:1] [stroke-dashoffset:1] group-has-checked/tab:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></label>
<label class="group/tab relative min-h-11 cursor-pointer pb-2 text-[24px] font-bold text-ttb27-mut italic transition-colors hover:text-ttb27-ink has-checked:text-ttb27-ink has-focus-visible:outline-2 has-focus-visible:outline-offset-6 has-focus-visible:outline-ttb27-ink"><input class="sr-only" type="radio" name="ttb27" id="ttb27-r3">Errata<svg aria-hidden="true" class="absolute -bottom-2 left-0 h-3.5 w-full overflow-visible" viewBox="0 0 100 14" preserveAspectRatio="none"><path pathLength="1" d="M2 9 Q 22 2 44 7 T 86 6 q 8-1 10 3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" class="transition-[stroke-dashoffset] duration-700 ease-[cubic-bezier(0.65,0,0.35,1)] [stroke-dasharray:1] [stroke-dashoffset:1] group-has-checked/tab:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></label>
</div>
<div class="max-w-[40ch] pt-2 font-ttb27-serif text-[17px] leading-relaxed text-ttb27-ash italic">
<p class="hidden group-has-[#ttb27-r1:checked]/tabs:block">The founding statement of intent, set in full measure.</p>
<p class="hidden group-has-[#ttb27-r2:checked]/tabs:block">The closing inscription: type, paper and press notes.</p>
<p class="hidden group-has-[#ttb27-r3:checked]/tabs:block">Corrections issued after the first printing.</p>
</div>
<p aria-hidden="true" class="rounded-full border border-ttb27-ink/15 bg-white/50 px-3.5 py-2 font-ttb27-mono text-[11.5px] text-ttb27-ash">pathLength="1" · [stroke-dashoffset:1] → 0</p>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-ttb27-bg: #fbf2d4;
--color-ttb27-bg: oklch(0.960 0.040 93.2);
--color-ttb27-ink: #0f4f3d;
--color-ttb27-ink: oklch(0.383 0.070 169.3);
--color-ttb27-mut: #4a7a6c;
--color-ttb27-mut: oklch(0.541 0.057 173.6);
--color-ttb27-ash: #3a3a42;
--color-ttb27-ash: oklch(0.352 0.014 285.7);
--font-ttb27-slab: 'Zilla Slab', Rockwell, serif;
--font-ttb27-serif: 'Newsreader', Georgia, serif;
--font-ttb27-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-27 {
width: 100%;
min-height: 100svh;
}
```How this works
Normalise the path. The original used stroke-dasharray:100, a guess at the curve's length; redraw the swash and the animation would stop short. With pathLength="1" the browser rescales the path to length 1:
<path pathLength="1" d="M2 9 Q 22 2 44 7 T 86 6 q 8-1 10 3"
class="[stroke-dasharray:1] [stroke-dashoffset:1]
transition-[stroke-dashoffset] duration-700
group-has-checked/tab:[stroke-dashoffset:0]"/>The dash is exactly one path long, the gap exactly one path long, and sliding the offset from 1 to 0 draws the whole stroke for any shape.
Make it yours
- Redraw
dfreely —pathLengthkeeps the draw correct. - Oxblood ink:
--color-ttb27-ink: #5c1a2b. - Draw on hover too: add
group-hover/tab:[stroke-dashoffset:0.6].
Gotchas — read before shipping
preserveAspectRatio="none"stretches the stroke width with the word; keep it modest.- The SVG is decorative (
aria-hidden). - Undrawing (on deselect) uses the same duration; shorten it with a separate rule if you want a snappier exit.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
pathLength is universal in SVG 2 engines.