22 / 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
Bauhaus Color Block Tabs in Tailwind CSS
Four primary tiles — red, yellow, black and cream — each marked with a Bauhaus primitive: circle, square, triangle, half-moon. The chosen tile rises 6px and drops a hard shadow; there's no shared highlight colour because the tile itself is the indicator.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<section class="ttb-22 group/tabs grid min-h-svh w-full place-items-center bg-ttb22-cream px-5 py-14 font-ttb22-sans text-ttb22-ink" aria-label="Bauhaus color block tabs demo">
<div class="grid w-full max-w-xl justify-items-center gap-7">
<div class="w-full">
<div role="radiogroup" aria-label="Principle" class="grid grid-cols-2 gap-2 pb-1.5 sm:grid-cols-4">
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-red p-3 text-ttb22-cream transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-ink)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r1" checked><svg aria-hidden="true" class="size-5 transition-[scale] duration-300 group-has-checked/tab:scale-125" viewBox="0 0 20 20"><circle cx="10" cy="10" r="9" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Form</span></label>
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-yellow p-3 text-ttb22-ink transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-ink)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r2"><svg aria-hidden="true" class="size-5 transition-[rotate] duration-300 group-has-checked/tab:rotate-45" viewBox="0 0 20 20"><rect x="2" y="2" width="16" height="16" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Grid</span></label>
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-ink p-3 text-ttb22-cream transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-red)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r3"><svg aria-hidden="true" class="size-5 transition-[rotate] duration-300 group-has-checked/tab:rotate-180" viewBox="0 0 20 20"><path d="M10 1.5 19 18.5H1z" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Type</span></label>
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-cream p-3 text-ttb22-ink ring-[1.5px] ring-ttb22-ink ring-inset transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-ink)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r4"><svg aria-hidden="true" class="size-5 transition-[rotate] duration-300 group-has-checked/tab:-rotate-90" viewBox="0 0 20 20"><path d="M1 14a9 9 0 0 1 18 0z" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Hue</span></label>
</div>
<div class="pt-5 font-ttb22-serif text-[16px] text-ttb22-ash italic">
<p class="hidden group-has-[#ttb22-r1:checked]/tabs:block">Composition, weight and balance.</p>
<p class="hidden group-has-[#ttb22-r2:checked]/tabs:block">Modular columns and rows.</p>
<p class="hidden group-has-[#ttb22-r3:checked]/tabs:block">Specimens and pairings.</p>
<p class="hidden group-has-[#ttb22-r4:checked]/tabs:block">A limited primary palette.</p>
</div>
</div>
<p aria-hidden="true" class="border-[1.5px] border-ttb22-ink px-3.5 py-2 font-ttb22-mono text-[11.5px]">has-checked:-translate-y-1.5 · shadow-[0_6px_0] · primitives</p>
</div>
</section><section class="ttb-22 group/tabs grid min-h-svh w-full place-items-center bg-ttb22-cream px-5 py-14 font-ttb22-sans text-ttb22-ink" aria-label="Bauhaus color block tabs demo">
<div class="grid w-full max-w-xl justify-items-center gap-7">
<div class="w-full">
<div role="radiogroup" aria-label="Principle" class="grid grid-cols-2 gap-2 pb-1.5 sm:grid-cols-4">
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-red p-3 text-ttb22-cream transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-ink)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r1" checked><svg aria-hidden="true" class="size-5 transition-[scale] duration-300 group-has-checked/tab:scale-125" viewBox="0 0 20 20"><circle cx="10" cy="10" r="9" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Form</span></label>
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-yellow p-3 text-ttb22-ink transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-ink)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r2"><svg aria-hidden="true" class="size-5 transition-[rotate] duration-300 group-has-checked/tab:rotate-45" viewBox="0 0 20 20"><rect x="2" y="2" width="16" height="16" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Grid</span></label>
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-ink p-3 text-ttb22-cream transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-red)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r3"><svg aria-hidden="true" class="size-5 transition-[rotate] duration-300 group-has-checked/tab:rotate-180" viewBox="0 0 20 20"><path d="M10 1.5 19 18.5H1z" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Type</span></label>
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-cream p-3 text-ttb22-ink ring-[1.5px] ring-ttb22-ink ring-inset transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-ink)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r4"><svg aria-hidden="true" class="size-5 transition-[rotate] duration-300 group-has-checked/tab:-rotate-90" viewBox="0 0 20 20"><path d="M1 14a9 9 0 0 1 18 0z" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Hue</span></label>
</div>
<div class="pt-5 font-ttb22-serif text-[16px] text-ttb22-ash italic">
<p class="hidden group-has-[#ttb22-r1:checked]/tabs:block">Composition, weight and balance.</p>
<p class="hidden group-has-[#ttb22-r2:checked]/tabs:block">Modular columns and rows.</p>
<p class="hidden group-has-[#ttb22-r3:checked]/tabs:block">Specimens and pairings.</p>
<p class="hidden group-has-[#ttb22-r4:checked]/tabs:block">A limited primary palette.</p>
</div>
</div>
<p aria-hidden="true" class="border-[1.5px] border-ttb22-ink px-3.5 py-2 font-ttb22-mono text-[11.5px]">has-checked:-translate-y-1.5 · shadow-[0_6px_0] · primitives</p>
</div>
</section>@import "tailwindcss";
@theme {
--color-ttb22-cream: #f5ead0;
--color-ttb22-cream: oklch(0.939 0.036 87.8);
--color-ttb22-red: #c43a32;
--color-ttb22-red: oklch(0.552 0.176 27.7);
--color-ttb22-yellow: #e0aa1c;
--color-ttb22-yellow: oklch(0.768 0.152 84.5);
--color-ttb22-ink: #1a1a1a;
--color-ttb22-ink: oklch(0.218 0 0);
--color-ttb22-ash: #3a3a42;
--color-ttb22-ash: oklch(0.352 0.014 285.7);
--font-ttb22-sans: 'Space Grotesk', system-ui, sans-serif;
--font-ttb22-serif: 'Newsreader', Georgia, serif;
--font-ttb22-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-22 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-ttb22-cream: #f5ead0;
--color-ttb22-cream: oklch(0.939 0.036 87.8);
--color-ttb22-red: #c43a32;
--color-ttb22-red: oklch(0.552 0.176 27.7);
--color-ttb22-yellow: #e0aa1c;
--color-ttb22-yellow: oklch(0.768 0.152 84.5);
--color-ttb22-ink: #1a1a1a;
--color-ttb22-ink: oklch(0.218 0 0);
--color-ttb22-ash: #3a3a42;
--color-ttb22-ash: oklch(0.352 0.014 285.7);
--font-ttb22-sans: 'Space Grotesk', system-ui, sans-serif;
--font-ttb22-serif: 'Newsreader', Georgia, serif;
--font-ttb22-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-22 {
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-ttb22-cream: #f5ead0;
--color-ttb22-cream: oklch(0.939 0.036 87.8);
--color-ttb22-red: #c43a32;
--color-ttb22-red: oklch(0.552 0.176 27.7);
--color-ttb22-yellow: #e0aa1c;
--color-ttb22-yellow: oklch(0.768 0.152 84.5);
--color-ttb22-ink: #1a1a1a;
--color-ttb22-ink: oklch(0.218 0 0);
--color-ttb22-ash: #3a3a42;
--color-ttb22-ash: oklch(0.352 0.014 285.7);
--font-ttb22-sans: 'Space Grotesk', system-ui, sans-serif;
--font-ttb22-serif: 'Newsreader', Georgia, serif;
--font-ttb22-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-22 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-ttb22-cream: #f5ead0;
--color-ttb22-cream: oklch(0.939 0.036 87.8);
--color-ttb22-red: #c43a32;
--color-ttb22-red: oklch(0.552 0.176 27.7);
--color-ttb22-yellow: #e0aa1c;
--color-ttb22-yellow: oklch(0.768 0.152 84.5);
--color-ttb22-ink: #1a1a1a;
--color-ttb22-ink: oklch(0.218 0 0);
--color-ttb22-ash: #3a3a42;
--color-ttb22-ash: oklch(0.352 0.014 285.7);
--font-ttb22-sans: 'Space Grotesk', system-ui, sans-serif;
--font-ttb22-serif: 'Newsreader', Georgia, serif;
--font-ttb22-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-22 {
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=Space+Grotesk:wght@500..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=Space+Grotesk:wght@500..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.
input:checked + .tt10blift and shadow becamehas-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_…].- The cream tile's combined
inset … , 0 6px 0shadow (repeated in two rules) became a ring plus the shared shadow utility — one place to edit each. - UI upgrade from the CSS original: each tile carries a Bauhaus primitive (circle, square, triangle, half-moon) that turns or grows when chosen; tiles are 80px tall and wrap to 2×2 on phones.
- UI upgrade: the black tile drops a red shadow instead of an invisible black-on-black one, and keyboard focus is now visible.
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: Bauhaus Color Block Tabs in Tailwind CSS
Source: https://codefronts.com/navigation/tailwind-css-tabs/bauhaus-color-block-tabs-tailwind-css/
Four primary tiles — red, yellow, black and cream — each marked with a Bauhaus primitive: circle, square, triangle, half-moon. The chosen tile rises 6px and drops a hard shadow; there's no shared highlight colour because the tile itself is the indicator.
## HTML
```html
<section class="ttb-22 group/tabs grid min-h-svh w-full place-items-center bg-ttb22-cream px-5 py-14 font-ttb22-sans text-ttb22-ink" aria-label="Bauhaus color block tabs demo">
<div class="grid w-full max-w-xl justify-items-center gap-7">
<div class="w-full">
<div role="radiogroup" aria-label="Principle" class="grid grid-cols-2 gap-2 pb-1.5 sm:grid-cols-4">
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-red p-3 text-ttb22-cream transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-ink)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r1" checked><svg aria-hidden="true" class="size-5 transition-[scale] duration-300 group-has-checked/tab:scale-125" viewBox="0 0 20 20"><circle cx="10" cy="10" r="9" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Form</span></label>
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-yellow p-3 text-ttb22-ink transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-ink)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r2"><svg aria-hidden="true" class="size-5 transition-[rotate] duration-300 group-has-checked/tab:rotate-45" viewBox="0 0 20 20"><rect x="2" y="2" width="16" height="16" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Grid</span></label>
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-ink p-3 text-ttb22-cream transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-red)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r3"><svg aria-hidden="true" class="size-5 transition-[rotate] duration-300 group-has-checked/tab:rotate-180" viewBox="0 0 20 20"><path d="M10 1.5 19 18.5H1z" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Type</span></label>
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-cream p-3 text-ttb22-ink ring-[1.5px] ring-ttb22-ink ring-inset transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-ink)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r4"><svg aria-hidden="true" class="size-5 transition-[rotate] duration-300 group-has-checked/tab:-rotate-90" viewBox="0 0 20 20"><path d="M1 14a9 9 0 0 1 18 0z" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Hue</span></label>
</div>
<div class="pt-5 font-ttb22-serif text-[16px] text-ttb22-ash italic">
<p class="hidden group-has-[#ttb22-r1:checked]/tabs:block">Composition, weight and balance.</p>
<p class="hidden group-has-[#ttb22-r2:checked]/tabs:block">Modular columns and rows.</p>
<p class="hidden group-has-[#ttb22-r3:checked]/tabs:block">Specimens and pairings.</p>
<p class="hidden group-has-[#ttb22-r4:checked]/tabs:block">A limited primary palette.</p>
</div>
</div>
<p aria-hidden="true" class="border-[1.5px] border-ttb22-ink px-3.5 py-2 font-ttb22-mono text-[11.5px]">has-checked:-translate-y-1.5 · shadow-[0_6px_0] · primitives</p>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-ttb22-cream: #f5ead0;
--color-ttb22-cream: oklch(0.939 0.036 87.8);
--color-ttb22-red: #c43a32;
--color-ttb22-red: oklch(0.552 0.176 27.7);
--color-ttb22-yellow: #e0aa1c;
--color-ttb22-yellow: oklch(0.768 0.152 84.5);
--color-ttb22-ink: #1a1a1a;
--color-ttb22-ink: oklch(0.218 0 0);
--color-ttb22-ash: #3a3a42;
--color-ttb22-ash: oklch(0.352 0.014 285.7);
--font-ttb22-sans: 'Space Grotesk', system-ui, sans-serif;
--font-ttb22-serif: 'Newsreader', Georgia, serif;
--font-ttb22-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-22 {
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: Bauhaus Color Block Tabs in Tailwind CSS
Source: https://codefronts.com/navigation/tailwind-css-tabs/bauhaus-color-block-tabs-tailwind-css/
Four primary tiles — red, yellow, black and cream — each marked with a Bauhaus primitive: circle, square, triangle, half-moon. The chosen tile rises 6px and drops a hard shadow; there's no shared highlight colour because the tile itself is the indicator.
## HTML
```html
<section class="ttb-22 group/tabs grid min-h-svh w-full place-items-center bg-ttb22-cream px-5 py-14 font-ttb22-sans text-ttb22-ink" aria-label="Bauhaus color block tabs demo">
<div class="grid w-full max-w-xl justify-items-center gap-7">
<div class="w-full">
<div role="radiogroup" aria-label="Principle" class="grid grid-cols-2 gap-2 pb-1.5 sm:grid-cols-4">
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-red p-3 text-ttb22-cream transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-ink)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r1" checked><svg aria-hidden="true" class="size-5 transition-[scale] duration-300 group-has-checked/tab:scale-125" viewBox="0 0 20 20"><circle cx="10" cy="10" r="9" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Form</span></label>
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-yellow p-3 text-ttb22-ink transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-ink)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r2"><svg aria-hidden="true" class="size-5 transition-[rotate] duration-300 group-has-checked/tab:rotate-45" viewBox="0 0 20 20"><rect x="2" y="2" width="16" height="16" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Grid</span></label>
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-ink p-3 text-ttb22-cream transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-red)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r3"><svg aria-hidden="true" class="size-5 transition-[rotate] duration-300 group-has-checked/tab:rotate-180" viewBox="0 0 20 20"><path d="M10 1.5 19 18.5H1z" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Type</span></label>
<label class="group/tab flex min-h-20 cursor-pointer flex-col items-start justify-between bg-ttb22-cream p-3 text-ttb22-ink ring-[1.5px] ring-ttb22-ink ring-inset transition-[translate,box-shadow] duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:-translate-y-0.5 has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-ink)] has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-ttb22-ink motion-reduce:transition-none"><input class="sr-only" type="radio" name="ttb22" id="ttb22-r4"><svg aria-hidden="true" class="size-5 transition-[rotate] duration-300 group-has-checked/tab:-rotate-90" viewBox="0 0 20 20"><path d="M1 14a9 9 0 0 1 18 0z" fill="currentColor"/></svg><span class="text-xs font-bold tracking-[0.22em] uppercase">Hue</span></label>
</div>
<div class="pt-5 font-ttb22-serif text-[16px] text-ttb22-ash italic">
<p class="hidden group-has-[#ttb22-r1:checked]/tabs:block">Composition, weight and balance.</p>
<p class="hidden group-has-[#ttb22-r2:checked]/tabs:block">Modular columns and rows.</p>
<p class="hidden group-has-[#ttb22-r3:checked]/tabs:block">Specimens and pairings.</p>
<p class="hidden group-has-[#ttb22-r4:checked]/tabs:block">A limited primary palette.</p>
</div>
</div>
<p aria-hidden="true" class="border-[1.5px] border-ttb22-ink px-3.5 py-2 font-ttb22-mono text-[11.5px]">has-checked:-translate-y-1.5 · shadow-[0_6px_0] · primitives</p>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-ttb22-cream: #f5ead0;
--color-ttb22-cream: oklch(0.939 0.036 87.8);
--color-ttb22-red: #c43a32;
--color-ttb22-red: oklch(0.552 0.176 27.7);
--color-ttb22-yellow: #e0aa1c;
--color-ttb22-yellow: oklch(0.768 0.152 84.5);
--color-ttb22-ink: #1a1a1a;
--color-ttb22-ink: oklch(0.218 0 0);
--color-ttb22-ash: #3a3a42;
--color-ttb22-ash: oklch(0.352 0.014 285.7);
--font-ttb22-sans: 'Space Grotesk', system-ui, sans-serif;
--font-ttb22-serif: 'Newsreader', Georgia, serif;
--font-ttb22-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-22 {
width: 100%;
min-height: 100svh;
}
```How this works
The shadow is where the tile was. A 6px lift and a 6px zero-blur shadow move together; change one and you must change the other:
has-checked:-translate-y-1.5 has-checked:shadow-[0_6px_0_var(--color-ttb22-ink)]The cream tile keeps its inset ring when lifted because the ring is a separate ring utility, not part of the shadow stack the original had to repeat in two rules.
Make it yours
- Your own primaries: keep three heavy tiles and one paper tile.
- Stricter Swiss: replace the overshoot ease with
ease-out. - Drop the shapes for text-only tiles.
Gotchas — read before shipping
- Each tile needs its own text colour for contrast — yellow takes ink, red takes cream.
- Lifted tiles need bottom padding on the row or the shadow clips.
- Shapes are
aria-hidden; the word names the tab.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
:has() for panels; everything else is universal.