25 / 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
Tailwind Pill Tab Bar with Icons
A dark capsule of icon tabs; the active one becomes a hot-pink pill that grows to make room for its label. Flex growth, icon scale and label reveal share one spring curve. The port gives the pill a soft pink bloom and keeps every collapsed label in the accessibility tree.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<section class="ttb-25 grid min-h-svh w-full place-items-center bg-ttb25-bg px-5 py-14 font-ttb25-sans text-ttb25-paper" aria-label="Pill tab bar with icons demo">
<div class="grid w-full max-w-md justify-items-center gap-8">
<div role="radiogroup" aria-label="Library" class="flex w-full gap-1.5 rounded-full bg-white/[0.04] p-1.5 ring-1 ring-white/8">
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r1" checked><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 11l9-8 9 8M5 9.5V20h5v-6h4v6h5V9.5"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Home</span></label>
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r2"><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-5-5"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Search</span></label>
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r3"><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"><path d="M6 3h12v18l-6-4-6 4z"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Saved</span></label>
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r4"><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="12" cy="8" r="4"/><path d="M4 21v-1a7 7 0 0 1 7-7h2a7 7 0 0 1 7 7v1"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Profile</span></label>
</div>
<p aria-hidden="true" class="rounded-full border border-white/10 px-3.5 py-2 font-ttb25-mono text-[11.5px] text-ttb25-mut">has-checked:flex-[2.4] · label max-w-0 → 24 · spring ease</p>
</div>
</section><section class="ttb-25 grid min-h-svh w-full place-items-center bg-ttb25-bg px-5 py-14 font-ttb25-sans text-ttb25-paper" aria-label="Pill tab bar with icons demo">
<div class="grid w-full max-w-md justify-items-center gap-8">
<div role="radiogroup" aria-label="Library" class="flex w-full gap-1.5 rounded-full bg-white/[0.04] p-1.5 ring-1 ring-white/8">
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r1" checked><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 11l9-8 9 8M5 9.5V20h5v-6h4v6h5V9.5"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Home</span></label>
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r2"><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-5-5"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Search</span></label>
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r3"><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"><path d="M6 3h12v18l-6-4-6 4z"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Saved</span></label>
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r4"><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="12" cy="8" r="4"/><path d="M4 21v-1a7 7 0 0 1 7-7h2a7 7 0 0 1 7 7v1"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Profile</span></label>
</div>
<p aria-hidden="true" class="rounded-full border border-white/10 px-3.5 py-2 font-ttb25-mono text-[11.5px] text-ttb25-mut">has-checked:flex-[2.4] · label max-w-0 → 24 · spring ease</p>
</div>
</section>@import "tailwindcss";
@theme {
--color-ttb25-bg: #1d2124;
--color-ttb25-bg: oklch(0.245 0.008 240.2);
--color-ttb25-paper: #ece6d4;
--color-ttb25-paper: oklch(0.925 0.025 91.6);
--color-ttb25-mut: #aaa598;
--color-ttb25-mut: oklch(0.722 0.019 89.4);
--color-ttb25-pink: #f0559f;
--color-ttb25-pink: oklch(0.677 0.202 354.4);
--color-ttb25-ink: #1a1a1a;
--color-ttb25-ink: oklch(0.218 0 0);
--font-ttb25-sans: 'Geist', system-ui, sans-serif;
--font-ttb25-mono: 'Geist 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-25 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-ttb25-bg: #1d2124;
--color-ttb25-bg: oklch(0.245 0.008 240.2);
--color-ttb25-paper: #ece6d4;
--color-ttb25-paper: oklch(0.925 0.025 91.6);
--color-ttb25-mut: #aaa598;
--color-ttb25-mut: oklch(0.722 0.019 89.4);
--color-ttb25-pink: #f0559f;
--color-ttb25-pink: oklch(0.677 0.202 354.4);
--color-ttb25-ink: #1a1a1a;
--color-ttb25-ink: oklch(0.218 0 0);
--font-ttb25-sans: 'Geist', system-ui, sans-serif;
--font-ttb25-mono: 'Geist 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-25 {
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-ttb25-bg: #1d2124;
--color-ttb25-bg: oklch(0.245 0.008 240.2);
--color-ttb25-paper: #ece6d4;
--color-ttb25-paper: oklch(0.925 0.025 91.6);
--color-ttb25-mut: #aaa598;
--color-ttb25-mut: oklch(0.722 0.019 89.4);
--color-ttb25-pink: #f0559f;
--color-ttb25-pink: oklch(0.677 0.202 354.4);
--color-ttb25-ink: #1a1a1a;
--color-ttb25-ink: oklch(0.218 0 0);
--font-ttb25-sans: 'Geist', system-ui, sans-serif;
--font-ttb25-mono: 'Geist 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-25 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-ttb25-bg: #1d2124;
--color-ttb25-bg: oklch(0.245 0.008 240.2);
--color-ttb25-paper: #ece6d4;
--color-ttb25-paper: oklch(0.925 0.025 91.6);
--color-ttb25-mut: #aaa598;
--color-ttb25-mut: oklch(0.722 0.019 89.4);
--color-ttb25-pink: #f0559f;
--color-ttb25-pink: oklch(0.677 0.202 354.4);
--color-ttb25-ink: #1a1a1a;
--color-ttb25-ink: oklch(0.218 0 0);
--font-ttb25-sans: 'Geist', system-ui, sans-serif;
--font-ttb25-mono: 'Geist 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-25 {
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=Geist:wght@400..800&family=Geist+Mono:wght@400..600&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=Geist:wght@400..800&family=Geist+Mono:wght@400..600&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
input:checked + .tt13b { flex: 2.4 }becamehas-checked:flex-[2.4]; the label reveal becamegroup-has-checked/tab:max-w-24withdelay-50.- The original's unpositioned nav let the absolute radios escape to the viewport; with radios inside their labels and
sr-only, nothing escapes. - UI upgrade from the CSS original: the active pill blooms with a pink shadow derived from its own token, and the saved icon is a bookmark rather than a shopping bag.
- UI upgrade: inactive labels moved from 55% cream (≈4.0:1) to a 6.7: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: Tailwind Pill Tab Bar with Icons
Source: https://codefronts.com/navigation/tailwind-css-tabs/tailwind-pill-tab-bar-icons/
A dark capsule of icon tabs; the active one becomes a hot-pink pill that grows to make room for its label. Flex growth, icon scale and label reveal share one spring curve. The port gives the pill a soft pink bloom and keeps every collapsed label in the accessibility tree.
## HTML
```html
<section class="ttb-25 grid min-h-svh w-full place-items-center bg-ttb25-bg px-5 py-14 font-ttb25-sans text-ttb25-paper" aria-label="Pill tab bar with icons demo">
<div class="grid w-full max-w-md justify-items-center gap-8">
<div role="radiogroup" aria-label="Library" class="flex w-full gap-1.5 rounded-full bg-white/[0.04] p-1.5 ring-1 ring-white/8">
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r1" checked><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 11l9-8 9 8M5 9.5V20h5v-6h4v6h5V9.5"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Home</span></label>
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r2"><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-5-5"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Search</span></label>
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r3"><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"><path d="M6 3h12v18l-6-4-6 4z"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Saved</span></label>
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r4"><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="12" cy="8" r="4"/><path d="M4 21v-1a7 7 0 0 1 7-7h2a7 7 0 0 1 7 7v1"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Profile</span></label>
</div>
<p aria-hidden="true" class="rounded-full border border-white/10 px-3.5 py-2 font-ttb25-mono text-[11.5px] text-ttb25-mut">has-checked:flex-[2.4] · label max-w-0 → 24 · spring ease</p>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-ttb25-bg: #1d2124;
--color-ttb25-bg: oklch(0.245 0.008 240.2);
--color-ttb25-paper: #ece6d4;
--color-ttb25-paper: oklch(0.925 0.025 91.6);
--color-ttb25-mut: #aaa598;
--color-ttb25-mut: oklch(0.722 0.019 89.4);
--color-ttb25-pink: #f0559f;
--color-ttb25-pink: oklch(0.677 0.202 354.4);
--color-ttb25-ink: #1a1a1a;
--color-ttb25-ink: oklch(0.218 0 0);
--font-ttb25-sans: 'Geist', system-ui, sans-serif;
--font-ttb25-mono: 'Geist 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-25 {
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: Tailwind Pill Tab Bar with Icons
Source: https://codefronts.com/navigation/tailwind-css-tabs/tailwind-pill-tab-bar-icons/
A dark capsule of icon tabs; the active one becomes a hot-pink pill that grows to make room for its label. Flex growth, icon scale and label reveal share one spring curve. The port gives the pill a soft pink bloom and keeps every collapsed label in the accessibility tree.
## HTML
```html
<section class="ttb-25 grid min-h-svh w-full place-items-center bg-ttb25-bg px-5 py-14 font-ttb25-sans text-ttb25-paper" aria-label="Pill tab bar with icons demo">
<div class="grid w-full max-w-md justify-items-center gap-8">
<div role="radiogroup" aria-label="Library" class="flex w-full gap-1.5 rounded-full bg-white/[0.04] p-1.5 ring-1 ring-white/8">
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r1" checked><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 11l9-8 9 8M5 9.5V20h5v-6h4v6h5V9.5"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Home</span></label>
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r2"><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-5-5"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Search</span></label>
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r3"><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"><path d="M6 3h12v18l-6-4-6 4z"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Saved</span></label>
<label class="group/tab flex min-h-11 flex-1 cursor-pointer items-center justify-center gap-2 rounded-full text-[13px] font-bold text-ttb25-mut transition-[flex-grow,background-color,color,box-shadow] duration-450 ease-[cubic-bezier(0.34,1.4,0.5,1)] hover:text-ttb25-paper has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink has-checked:shadow-[0_6px_18px_-6px_color-mix(in_oklab,var(--color-ttb25-pink)_70%,transparent)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ttb25-pink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb25" id="ttb25-r4"><svg aria-hidden="true" class="size-[18px] flex-none transition-transform duration-400 group-has-checked/tab:scale-110" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="12" cy="8" r="4"/><path d="M4 21v-1a7 7 0 0 1 7-7h2a7 7 0 0 1 7 7v1"/></svg><span class="max-w-0 overflow-hidden whitespace-nowrap transition-[max-width] delay-50 duration-450 group-has-checked/tab:max-w-24 motion-reduce:transition-none">Profile</span></label>
</div>
<p aria-hidden="true" class="rounded-full border border-white/10 px-3.5 py-2 font-ttb25-mono text-[11.5px] text-ttb25-mut">has-checked:flex-[2.4] · label max-w-0 → 24 · spring ease</p>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-ttb25-bg: #1d2124;
--color-ttb25-bg: oklch(0.245 0.008 240.2);
--color-ttb25-paper: #ece6d4;
--color-ttb25-paper: oklch(0.925 0.025 91.6);
--color-ttb25-mut: #aaa598;
--color-ttb25-mut: oklch(0.722 0.019 89.4);
--color-ttb25-pink: #f0559f;
--color-ttb25-pink: oklch(0.677 0.202 354.4);
--color-ttb25-ink: #1a1a1a;
--color-ttb25-ink: oklch(0.218 0 0);
--font-ttb25-sans: 'Geist', system-ui, sans-serif;
--font-ttb25-mono: 'Geist 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-25 {
width: 100%;
min-height: 100svh;
}
```How this works
Grow the item, reveal the text. The checked item's flex factor rises, so its siblings give up space; inside it the label's max-width opens a beat later:
<label class="flex-1 transition-[flex-grow,background-color,color]
has-checked:flex-[2.4] has-checked:bg-ttb25-pink has-checked:text-ttb25-ink">
<svg class="group-has-checked/tab:scale-110">…</svg>
<span class="max-w-0 delay-50 group-has-checked/tab:max-w-24">Search</span>The spring cubic-bezier(0.34,1.4,0.5,1) overshoots slightly, so the pill settles rather than stops.
Make it yours
- Light capsule: track
bg-black/4, inactive labels at 60% ink. - Brand accent: swap the pink token; check dark text still passes 4.5:1.
- Five items: reduce
flex-[2.4]toflex-[2].
Gotchas — read before shipping
- Avoid
flex-wrapon the capsule — wrapping during a flex transition thrashes layout. - Pastel accents fail with dark text; stay saturated.
- Collapsed labels are zero-width, not hidden, so they still name each radio.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
No :has() panels; only has-checked:.