21 / 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
Bracket Selection Tabs in Tailwind CSS
A pair of crimson brackets frames the active word and slides between choices. The original positioned two spans from measured offsets; the port puts both brackets inside one span the width of a column and moves that span — the brackets stay pinned to the cell edges and travel together.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<section class="ttb-21 group/tabs grid min-h-svh w-full place-items-center bg-ttb21-bg px-5 py-14 font-ttb21-serif text-ttb21-paper" aria-label="Bracket selection tabs demo">
<div class="grid w-full max-w-md justify-items-center gap-8">
<div role="radiogroup" aria-label="Marker" class="relative grid w-full grid-cols-3 [--i:0] has-[#ttb21-r2:checked]:[--i:1] has-[#ttb21-r3:checked]:[--i:2]">
<label class="flex min-h-14 cursor-pointer items-center justify-center text-[26px] text-ttb21-mut transition-colors hover:text-ttb21-paper has-checked:text-ttb21-paper has-focus-visible:outline-1 has-focus-visible:-outline-offset-8 has-focus-visible:outline-dashed has-focus-visible:outline-ttb21-paper"><input class="sr-only" type="radio" name="ttb21" id="ttb21-r1" checked>One</label>
<label class="flex min-h-14 cursor-pointer items-center justify-center text-[26px] text-ttb21-mut transition-colors hover:text-ttb21-paper has-checked:text-ttb21-paper has-focus-visible:outline-1 has-focus-visible:-outline-offset-8 has-focus-visible:outline-dashed has-focus-visible:outline-ttb21-paper"><input class="sr-only" type="radio" name="ttb21" id="ttb21-r2">Two</label>
<label class="flex min-h-14 cursor-pointer items-center justify-center text-[26px] text-ttb21-mut transition-colors hover:text-ttb21-paper has-checked:text-ttb21-paper has-focus-visible:outline-1 has-focus-visible:-outline-offset-8 has-focus-visible:outline-dashed has-focus-visible:outline-ttb21-paper"><input class="sr-only" type="radio" name="ttb21" id="ttb21-r3">Three</label>
<span aria-hidden="true" class="pointer-events-none absolute inset-y-0 left-0 flex w-1/3 translate-x-[calc(var(--i)*100%)] items-center justify-between px-1 text-[44px] leading-none font-light text-ttb21-crimson transition-transform duration-500 ease-[cubic-bezier(0.65,0,0.35,1)] motion-reduce:transition-none"><span>[</span><span>]</span></span>
</div>
<div class="min-h-6 text-center text-[17px] text-ttb21-soft italic">
<p class="hidden transition-opacity duration-300 group-has-[#ttb21-r1:checked]/tabs:block starting:opacity-0">The first marker — a beginning.</p>
<p class="hidden transition-opacity duration-300 group-has-[#ttb21-r2:checked]/tabs:block starting:opacity-0">The second marker — a turn.</p>
<p class="hidden transition-opacity duration-300 group-has-[#ttb21-r3:checked]/tabs:block starting:opacity-0">The third marker — a close.</p>
</div>
<p aria-hidden="true" class="rounded-full border border-white/10 px-3.5 py-2 font-ttb21-mono text-[11.5px] text-ttb21-mut">one frame w-1/3 · justify-between brackets · translate by --i</p>
</div>
</section><section class="ttb-21 group/tabs grid min-h-svh w-full place-items-center bg-ttb21-bg px-5 py-14 font-ttb21-serif text-ttb21-paper" aria-label="Bracket selection tabs demo">
<div class="grid w-full max-w-md justify-items-center gap-8">
<div role="radiogroup" aria-label="Marker" class="relative grid w-full grid-cols-3 [--i:0] has-[#ttb21-r2:checked]:[--i:1] has-[#ttb21-r3:checked]:[--i:2]">
<label class="flex min-h-14 cursor-pointer items-center justify-center text-[26px] text-ttb21-mut transition-colors hover:text-ttb21-paper has-checked:text-ttb21-paper has-focus-visible:outline-1 has-focus-visible:-outline-offset-8 has-focus-visible:outline-dashed has-focus-visible:outline-ttb21-paper"><input class="sr-only" type="radio" name="ttb21" id="ttb21-r1" checked>One</label>
<label class="flex min-h-14 cursor-pointer items-center justify-center text-[26px] text-ttb21-mut transition-colors hover:text-ttb21-paper has-checked:text-ttb21-paper has-focus-visible:outline-1 has-focus-visible:-outline-offset-8 has-focus-visible:outline-dashed has-focus-visible:outline-ttb21-paper"><input class="sr-only" type="radio" name="ttb21" id="ttb21-r2">Two</label>
<label class="flex min-h-14 cursor-pointer items-center justify-center text-[26px] text-ttb21-mut transition-colors hover:text-ttb21-paper has-checked:text-ttb21-paper has-focus-visible:outline-1 has-focus-visible:-outline-offset-8 has-focus-visible:outline-dashed has-focus-visible:outline-ttb21-paper"><input class="sr-only" type="radio" name="ttb21" id="ttb21-r3">Three</label>
<span aria-hidden="true" class="pointer-events-none absolute inset-y-0 left-0 flex w-1/3 translate-x-[calc(var(--i)*100%)] items-center justify-between px-1 text-[44px] leading-none font-light text-ttb21-crimson transition-transform duration-500 ease-[cubic-bezier(0.65,0,0.35,1)] motion-reduce:transition-none"><span>[</span><span>]</span></span>
</div>
<div class="min-h-6 text-center text-[17px] text-ttb21-soft italic">
<p class="hidden transition-opacity duration-300 group-has-[#ttb21-r1:checked]/tabs:block starting:opacity-0">The first marker — a beginning.</p>
<p class="hidden transition-opacity duration-300 group-has-[#ttb21-r2:checked]/tabs:block starting:opacity-0">The second marker — a turn.</p>
<p class="hidden transition-opacity duration-300 group-has-[#ttb21-r3:checked]/tabs:block starting:opacity-0">The third marker — a close.</p>
</div>
<p aria-hidden="true" class="rounded-full border border-white/10 px-3.5 py-2 font-ttb21-mono text-[11.5px] text-ttb21-mut">one frame w-1/3 · justify-between brackets · translate by --i</p>
</div>
</section>@import "tailwindcss";
@theme {
--color-ttb21-bg: #25222e;
--color-ttb21-bg: oklch(0.261 0.023 296.3);
--color-ttb21-paper: #ece6d4;
--color-ttb21-paper: oklch(0.925 0.025 91.6);
--color-ttb21-soft: #cfc9b8;
--color-ttb21-soft: oklch(0.836 0.024 90.8);
--color-ttb21-mut: #a9a395;
--color-ttb21-mut: oklch(0.717 0.021 87.5);
--color-ttb21-crimson: #f04a5f;
--color-ttb21-crimson: oklch(0.649 0.201 17.8);
--font-ttb21-serif: 'Instrument Serif', Georgia, serif;
--font-ttb21-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-21 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-ttb21-bg: #25222e;
--color-ttb21-bg: oklch(0.261 0.023 296.3);
--color-ttb21-paper: #ece6d4;
--color-ttb21-paper: oklch(0.925 0.025 91.6);
--color-ttb21-soft: #cfc9b8;
--color-ttb21-soft: oklch(0.836 0.024 90.8);
--color-ttb21-mut: #a9a395;
--color-ttb21-mut: oklch(0.717 0.021 87.5);
--color-ttb21-crimson: #f04a5f;
--color-ttb21-crimson: oklch(0.649 0.201 17.8);
--font-ttb21-serif: 'Instrument Serif', Georgia, serif;
--font-ttb21-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-21 {
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-ttb21-bg: #25222e;
--color-ttb21-bg: oklch(0.261 0.023 296.3);
--color-ttb21-paper: #ece6d4;
--color-ttb21-paper: oklch(0.925 0.025 91.6);
--color-ttb21-soft: #cfc9b8;
--color-ttb21-soft: oklch(0.836 0.024 90.8);
--color-ttb21-mut: #a9a395;
--color-ttb21-mut: oklch(0.717 0.021 87.5);
--color-ttb21-crimson: #f04a5f;
--color-ttb21-crimson: oklch(0.649 0.201 17.8);
--font-ttb21-serif: 'Instrument Serif', Georgia, serif;
--font-ttb21-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-21 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-ttb21-bg: #25222e;
--color-ttb21-bg: oklch(0.261 0.023 296.3);
--color-ttb21-paper: #ece6d4;
--color-ttb21-paper: oklch(0.925 0.025 91.6);
--color-ttb21-soft: #cfc9b8;
--color-ttb21-soft: oklch(0.836 0.024 90.8);
--color-ttb21-mut: #a9a395;
--color-ttb21-mut: oklch(0.717 0.021 87.5);
--color-ttb21-crimson: #f04a5f;
--color-ttb21-crimson: oklch(0.649 0.201 17.8);
--font-ttb21-serif: 'Instrument Serif', Georgia, serif;
--font-ttb21-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-21 {
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=Instrument+Serif:ital@0;1&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=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
- Two independently positioned bracket spans (
offsetLeft − 20,offsetLeft + offsetWidth + 4) became one column-wide frame withjustify-between, moved bytranslate-x-[calc(var(--i)*100%)]. - The brackets now animate
transformrather thanleft, so the slide stays on the compositor. - UI upgrade from the CSS original: the brackets started stacked at
left:0until JavaScript ran (a visible first-paint glitch); they're correct on first paint now. - UI upgrade: crimson brightened to 4.6:1 on the stage (was 3.3:1), resting words raised from 50% to a 6.5:1 token, and panels fade in with
starting:.
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: Bracket Selection Tabs in Tailwind CSS
Source: https://codefronts.com/navigation/tailwind-css-tabs/bracket-selection-tabs-tailwind-css/
A pair of crimson brackets frames the active word and slides between choices. The original positioned two spans from measured offsets; the port puts both brackets inside one span the width of a column and moves that span — the brackets stay pinned to the cell edges and travel together.
## HTML
```html
<section class="ttb-21 group/tabs grid min-h-svh w-full place-items-center bg-ttb21-bg px-5 py-14 font-ttb21-serif text-ttb21-paper" aria-label="Bracket selection tabs demo">
<div class="grid w-full max-w-md justify-items-center gap-8">
<div role="radiogroup" aria-label="Marker" class="relative grid w-full grid-cols-3 [--i:0] has-[#ttb21-r2:checked]:[--i:1] has-[#ttb21-r3:checked]:[--i:2]">
<label class="flex min-h-14 cursor-pointer items-center justify-center text-[26px] text-ttb21-mut transition-colors hover:text-ttb21-paper has-checked:text-ttb21-paper has-focus-visible:outline-1 has-focus-visible:-outline-offset-8 has-focus-visible:outline-dashed has-focus-visible:outline-ttb21-paper"><input class="sr-only" type="radio" name="ttb21" id="ttb21-r1" checked>One</label>
<label class="flex min-h-14 cursor-pointer items-center justify-center text-[26px] text-ttb21-mut transition-colors hover:text-ttb21-paper has-checked:text-ttb21-paper has-focus-visible:outline-1 has-focus-visible:-outline-offset-8 has-focus-visible:outline-dashed has-focus-visible:outline-ttb21-paper"><input class="sr-only" type="radio" name="ttb21" id="ttb21-r2">Two</label>
<label class="flex min-h-14 cursor-pointer items-center justify-center text-[26px] text-ttb21-mut transition-colors hover:text-ttb21-paper has-checked:text-ttb21-paper has-focus-visible:outline-1 has-focus-visible:-outline-offset-8 has-focus-visible:outline-dashed has-focus-visible:outline-ttb21-paper"><input class="sr-only" type="radio" name="ttb21" id="ttb21-r3">Three</label>
<span aria-hidden="true" class="pointer-events-none absolute inset-y-0 left-0 flex w-1/3 translate-x-[calc(var(--i)*100%)] items-center justify-between px-1 text-[44px] leading-none font-light text-ttb21-crimson transition-transform duration-500 ease-[cubic-bezier(0.65,0,0.35,1)] motion-reduce:transition-none"><span>[</span><span>]</span></span>
</div>
<div class="min-h-6 text-center text-[17px] text-ttb21-soft italic">
<p class="hidden transition-opacity duration-300 group-has-[#ttb21-r1:checked]/tabs:block starting:opacity-0">The first marker — a beginning.</p>
<p class="hidden transition-opacity duration-300 group-has-[#ttb21-r2:checked]/tabs:block starting:opacity-0">The second marker — a turn.</p>
<p class="hidden transition-opacity duration-300 group-has-[#ttb21-r3:checked]/tabs:block starting:opacity-0">The third marker — a close.</p>
</div>
<p aria-hidden="true" class="rounded-full border border-white/10 px-3.5 py-2 font-ttb21-mono text-[11.5px] text-ttb21-mut">one frame w-1/3 · justify-between brackets · translate by --i</p>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-ttb21-bg: #25222e;
--color-ttb21-bg: oklch(0.261 0.023 296.3);
--color-ttb21-paper: #ece6d4;
--color-ttb21-paper: oklch(0.925 0.025 91.6);
--color-ttb21-soft: #cfc9b8;
--color-ttb21-soft: oklch(0.836 0.024 90.8);
--color-ttb21-mut: #a9a395;
--color-ttb21-mut: oklch(0.717 0.021 87.5);
--color-ttb21-crimson: #f04a5f;
--color-ttb21-crimson: oklch(0.649 0.201 17.8);
--font-ttb21-serif: 'Instrument Serif', Georgia, serif;
--font-ttb21-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-21 {
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: Bracket Selection Tabs in Tailwind CSS
Source: https://codefronts.com/navigation/tailwind-css-tabs/bracket-selection-tabs-tailwind-css/
A pair of crimson brackets frames the active word and slides between choices. The original positioned two spans from measured offsets; the port puts both brackets inside one span the width of a column and moves that span — the brackets stay pinned to the cell edges and travel together.
## HTML
```html
<section class="ttb-21 group/tabs grid min-h-svh w-full place-items-center bg-ttb21-bg px-5 py-14 font-ttb21-serif text-ttb21-paper" aria-label="Bracket selection tabs demo">
<div class="grid w-full max-w-md justify-items-center gap-8">
<div role="radiogroup" aria-label="Marker" class="relative grid w-full grid-cols-3 [--i:0] has-[#ttb21-r2:checked]:[--i:1] has-[#ttb21-r3:checked]:[--i:2]">
<label class="flex min-h-14 cursor-pointer items-center justify-center text-[26px] text-ttb21-mut transition-colors hover:text-ttb21-paper has-checked:text-ttb21-paper has-focus-visible:outline-1 has-focus-visible:-outline-offset-8 has-focus-visible:outline-dashed has-focus-visible:outline-ttb21-paper"><input class="sr-only" type="radio" name="ttb21" id="ttb21-r1" checked>One</label>
<label class="flex min-h-14 cursor-pointer items-center justify-center text-[26px] text-ttb21-mut transition-colors hover:text-ttb21-paper has-checked:text-ttb21-paper has-focus-visible:outline-1 has-focus-visible:-outline-offset-8 has-focus-visible:outline-dashed has-focus-visible:outline-ttb21-paper"><input class="sr-only" type="radio" name="ttb21" id="ttb21-r2">Two</label>
<label class="flex min-h-14 cursor-pointer items-center justify-center text-[26px] text-ttb21-mut transition-colors hover:text-ttb21-paper has-checked:text-ttb21-paper has-focus-visible:outline-1 has-focus-visible:-outline-offset-8 has-focus-visible:outline-dashed has-focus-visible:outline-ttb21-paper"><input class="sr-only" type="radio" name="ttb21" id="ttb21-r3">Three</label>
<span aria-hidden="true" class="pointer-events-none absolute inset-y-0 left-0 flex w-1/3 translate-x-[calc(var(--i)*100%)] items-center justify-between px-1 text-[44px] leading-none font-light text-ttb21-crimson transition-transform duration-500 ease-[cubic-bezier(0.65,0,0.35,1)] motion-reduce:transition-none"><span>[</span><span>]</span></span>
</div>
<div class="min-h-6 text-center text-[17px] text-ttb21-soft italic">
<p class="hidden transition-opacity duration-300 group-has-[#ttb21-r1:checked]/tabs:block starting:opacity-0">The first marker — a beginning.</p>
<p class="hidden transition-opacity duration-300 group-has-[#ttb21-r2:checked]/tabs:block starting:opacity-0">The second marker — a turn.</p>
<p class="hidden transition-opacity duration-300 group-has-[#ttb21-r3:checked]/tabs:block starting:opacity-0">The third marker — a close.</p>
</div>
<p aria-hidden="true" class="rounded-full border border-white/10 px-3.5 py-2 font-ttb21-mono text-[11.5px] text-ttb21-mut">one frame w-1/3 · justify-between brackets · translate by --i</p>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-ttb21-bg: #25222e;
--color-ttb21-bg: oklch(0.261 0.023 296.3);
--color-ttb21-paper: #ece6d4;
--color-ttb21-paper: oklch(0.925 0.025 91.6);
--color-ttb21-soft: #cfc9b8;
--color-ttb21-soft: oklch(0.836 0.024 90.8);
--color-ttb21-mut: #a9a395;
--color-ttb21-mut: oklch(0.717 0.021 87.5);
--color-ttb21-crimson: #f04a5f;
--color-ttb21-crimson: oklch(0.649 0.201 17.8);
--font-ttb21-serif: 'Instrument Serif', Georgia, serif;
--font-ttb21-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-21 {
width: 100%;
min-height: 100svh;
}
```How this works
Move the frame, not the marks. Both brackets live in one absolutely positioned span exactly one column wide:
<span class="absolute inset-y-0 left-0 flex w-1/3 justify-between
translate-x-[calc(var(--i)*100%)] transition-transform">
<span>[</span><span>]</span>
</span>That replaces two independent left offsets with one transform and can never desynchronise.
Make it yours
- Code flavour: braces
{ }or chevrons⟨ ⟩. - Bold brackets:
font-boldon the marks reads as editor UI. - Four choices:
grid-cols-4andw-1/4.
Gotchas — read before shipping
- The brackets are decorative (
aria-hidden); selection is announced by the radio. - Equal columns are required; long and short words share the same cell width.
- Short words in wide cells leave air inside the brackets; tighten with
px-4on the frame if needed.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
:has() drives the index.