17 / 29
All 29 in 29 Tailwind CSS Checkboxes
- 01Tailwind CSS Toggle Switch — iOS-Style SaaS Settings
- 02Tailwind Filter Chip Checkbox — Style Checkbox as Button
- 03Tailwind Pricing Plan Card Select — Checkbox-Style Selectable Cards
- 04Pure Tailwind CSS Accordion with Checkbox — No JavaScript
- 05Tailwind Indeterminate Checkbox — Select All with Tri-State
- 06Accessible Custom Checkbox in Tailwind CSS — WCAG Focus Ring
- 07Tailwind Slide Toggle with ON/OFF Labels — GPU translate3d
- 08Neon Glow Checkbox in Tailwind CSS — Dark Mode Gaming UI
- 09Animated SVG Checkmark in Tailwind CSS — stroke-dashoffset Draw
- 10Bouncy Checkbox Animation in Tailwind CSS — Spring cubic-bezier
- 11Glassmorphism Checkbox in Tailwind CSS — backdrop-blur Frosted Glass
- 12Neumorphism Checkbox in Tailwind CSS — Soft UI
- 13Liquid Fill Checkbox Animation in Tailwind CSS — Water Wave
- 14Rotating Ring Checkbox in Tailwind CSS — Spin-to-Check
- 15Brutalist Checkbox in Tailwind CSS — Neo-Brutalism Hard Shadow
- 16Animated Gradient Checkbox in Tailwind CSS — Rainbow Sweep
- 173D Flip Checkbox in Tailwind CSS — perspective & backface-hidden
- 18Material Ripple Checkbox in Tailwind CSS — State Layer & Wave
- 19Retro Pixel Art Checkbox in Tailwind CSS — 8-Bit Arcade Menu
- 20Tailwind CSS To-Do List Checkbox with Animated Strikethrough
- 21Gooey Blob Checkbox in Tailwind CSS — blur + contrast Filter
- 22Tailwind Dark Mode Toggle Switch — Sun & Moon, No JavaScript
- 23Pulse Ring Checkbox in Tailwind CSS — Live Status Indicator
- 24Tailwind CSS Dash-to-Check SVG Morph Checkbox
- 25Tri-State Checkbox in Tailwind CSS + JavaScript — Done / N/A / Unset
- 26Magnetic Hover Checkbox in Tailwind CSS + JavaScript
- 27Confetti Checkbox Animation in Tailwind CSS — Pure CSS Particle Burst
- 28Slide-In Label Checkbox in Tailwind CSS — Saved Tag Reveal
- 29Aurora Gradient Toggle Switch in Tailwind CSS — Premium Dark UI
3D Flip Checkbox in Tailwind CSS — perspective & backface-hidden
Each box is a two-faced card that flips on its Y axis to reveal a filled, ticked back — now using Tailwind v4's native 3D utilities: perspective-[600px], transform-3d, backface-hidden and rotate-y-180. Reduced-motion users get a cross-fade instead.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<section class="tcb-17 w-full min-h-svh grid place-items-center bg-tcb17-bg px-5 py-14 font-tcb17-sans text-tcb17-ink selection:bg-tcb17-acc selection:text-white" aria-label="3D flip checkboxes">
<div class="w-full max-w-[25rem] rounded-2xl border border-tcb17-line bg-white px-4 py-2.5">
<label class="group flex min-h-14 cursor-pointer items-center gap-4 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="block size-7 flex-none rounded-lg perspective-[600px] peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb17-acc"><span class="relative block size-full transition-transform duration-500 ease-[cubic-bezier(.4,.8,.3,1)] transform-3d group-has-checked:rotate-y-180 motion-reduce:transition-none motion-reduce:group-has-checked:rotate-y-0"><span class="absolute inset-0 rounded-lg border-2 border-tcb17-box bg-white backface-hidden transition-[border-color,opacity] group-hover:border-tcb17-acc motion-reduce:group-has-checked:opacity-0"></span><span class="absolute inset-0 grid rotate-y-180 place-items-center rounded-lg bg-tcb17-acc text-white backface-hidden motion-reduce:rotate-y-0 motion-reduce:opacity-0 motion-reduce:transition-opacity motion-reduce:group-has-checked:opacity-100"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="size-4"><path d="M20 6 9 17l-5-5"/></svg></span></span></span><span class="text-[15px]">Task complete</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-4 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="block size-7 flex-none rounded-lg perspective-[600px] peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb17-acc"><span class="relative block size-full transition-transform duration-500 ease-[cubic-bezier(.4,.8,.3,1)] transform-3d group-has-checked:rotate-y-180 motion-reduce:transition-none motion-reduce:group-has-checked:rotate-y-0"><span class="absolute inset-0 rounded-lg border-2 border-tcb17-box bg-white backface-hidden transition-[border-color,opacity] group-hover:border-tcb17-acc motion-reduce:group-has-checked:opacity-0"></span><span class="absolute inset-0 grid rotate-y-180 place-items-center rounded-lg bg-tcb17-acc text-white backface-hidden motion-reduce:rotate-y-0 motion-reduce:opacity-0 motion-reduce:transition-opacity motion-reduce:group-has-checked:opacity-100"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="size-4"><path d="M20 6 9 17l-5-5"/></svg></span></span></span><span class="text-[15px]">Mark as read</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-4 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="block size-7 flex-none rounded-lg perspective-[600px] peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb17-acc"><span class="relative block size-full transition-transform duration-500 ease-[cubic-bezier(.4,.8,.3,1)] transform-3d group-has-checked:rotate-y-180 motion-reduce:transition-none motion-reduce:group-has-checked:rotate-y-0"><span class="absolute inset-0 rounded-lg border-2 border-tcb17-box bg-white backface-hidden transition-[border-color,opacity] group-hover:border-tcb17-acc motion-reduce:group-has-checked:opacity-0"></span><span class="absolute inset-0 grid rotate-y-180 place-items-center rounded-lg bg-tcb17-acc text-white backface-hidden motion-reduce:rotate-y-0 motion-reduce:opacity-0 motion-reduce:transition-opacity motion-reduce:group-has-checked:opacity-100"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="size-4"><path d="M20 6 9 17l-5-5"/></svg></span></span></span><span class="text-[15px]">Approve request</span></label>
</div>
</section><section class="tcb-17 w-full min-h-svh grid place-items-center bg-tcb17-bg px-5 py-14 font-tcb17-sans text-tcb17-ink selection:bg-tcb17-acc selection:text-white" aria-label="3D flip checkboxes">
<div class="w-full max-w-[25rem] rounded-2xl border border-tcb17-line bg-white px-4 py-2.5">
<label class="group flex min-h-14 cursor-pointer items-center gap-4 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="block size-7 flex-none rounded-lg perspective-[600px] peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb17-acc"><span class="relative block size-full transition-transform duration-500 ease-[cubic-bezier(.4,.8,.3,1)] transform-3d group-has-checked:rotate-y-180 motion-reduce:transition-none motion-reduce:group-has-checked:rotate-y-0"><span class="absolute inset-0 rounded-lg border-2 border-tcb17-box bg-white backface-hidden transition-[border-color,opacity] group-hover:border-tcb17-acc motion-reduce:group-has-checked:opacity-0"></span><span class="absolute inset-0 grid rotate-y-180 place-items-center rounded-lg bg-tcb17-acc text-white backface-hidden motion-reduce:rotate-y-0 motion-reduce:opacity-0 motion-reduce:transition-opacity motion-reduce:group-has-checked:opacity-100"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="size-4"><path d="M20 6 9 17l-5-5"/></svg></span></span></span><span class="text-[15px]">Task complete</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-4 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="block size-7 flex-none rounded-lg perspective-[600px] peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb17-acc"><span class="relative block size-full transition-transform duration-500 ease-[cubic-bezier(.4,.8,.3,1)] transform-3d group-has-checked:rotate-y-180 motion-reduce:transition-none motion-reduce:group-has-checked:rotate-y-0"><span class="absolute inset-0 rounded-lg border-2 border-tcb17-box bg-white backface-hidden transition-[border-color,opacity] group-hover:border-tcb17-acc motion-reduce:group-has-checked:opacity-0"></span><span class="absolute inset-0 grid rotate-y-180 place-items-center rounded-lg bg-tcb17-acc text-white backface-hidden motion-reduce:rotate-y-0 motion-reduce:opacity-0 motion-reduce:transition-opacity motion-reduce:group-has-checked:opacity-100"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="size-4"><path d="M20 6 9 17l-5-5"/></svg></span></span></span><span class="text-[15px]">Mark as read</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-4 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="block size-7 flex-none rounded-lg perspective-[600px] peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb17-acc"><span class="relative block size-full transition-transform duration-500 ease-[cubic-bezier(.4,.8,.3,1)] transform-3d group-has-checked:rotate-y-180 motion-reduce:transition-none motion-reduce:group-has-checked:rotate-y-0"><span class="absolute inset-0 rounded-lg border-2 border-tcb17-box bg-white backface-hidden transition-[border-color,opacity] group-hover:border-tcb17-acc motion-reduce:group-has-checked:opacity-0"></span><span class="absolute inset-0 grid rotate-y-180 place-items-center rounded-lg bg-tcb17-acc text-white backface-hidden motion-reduce:rotate-y-0 motion-reduce:opacity-0 motion-reduce:transition-opacity motion-reduce:group-has-checked:opacity-100"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="size-4"><path d="M20 6 9 17l-5-5"/></svg></span></span></span><span class="text-[15px]">Approve request</span></label>
</div>
</section>@import "tailwindcss";
@theme {
--color-tcb17-bg: #eef5f4;
--color-tcb17-bg: oklch(0.965 0.008 180);
--color-tcb17-ink: #2b3a38;
--color-tcb17-ink: oklch(0.33 0.02 180);
--color-tcb17-line: #dbe8e6;
--color-tcb17-line: oklch(0.92 0.012 180);
--color-tcb17-box: #8fb0ab;
--color-tcb17-box: oklch(0.72 0.04 180);
--color-tcb17-acc: #127a70;
--color-tcb17-acc: oklch(0.5 0.1 180);
--font-tcb17-sans: 'Instrument Sans', system-ui, sans-serif;
}
/* 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. */
.tcb-17 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-tcb17-bg: #eef5f4;
--color-tcb17-bg: oklch(0.965 0.008 180);
--color-tcb17-ink: #2b3a38;
--color-tcb17-ink: oklch(0.33 0.02 180);
--color-tcb17-line: #dbe8e6;
--color-tcb17-line: oklch(0.92 0.012 180);
--color-tcb17-box: #8fb0ab;
--color-tcb17-box: oklch(0.72 0.04 180);
--color-tcb17-acc: #127a70;
--color-tcb17-acc: oklch(0.5 0.1 180);
--font-tcb17-sans: 'Instrument Sans', system-ui, sans-serif;
}
/* 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. */
.tcb-17 {
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-tcb17-bg: #eef5f4;
--color-tcb17-bg: oklch(0.965 0.008 180);
--color-tcb17-ink: #2b3a38;
--color-tcb17-ink: oklch(0.33 0.02 180);
--color-tcb17-line: #dbe8e6;
--color-tcb17-line: oklch(0.92 0.012 180);
--color-tcb17-box: #8fb0ab;
--color-tcb17-box: oklch(0.72 0.04 180);
--color-tcb17-acc: #127a70;
--color-tcb17-acc: oklch(0.5 0.1 180);
--font-tcb17-sans: 'Instrument Sans', system-ui, sans-serif;
}
/* 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. */
.tcb-17 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-tcb17-bg: #eef5f4;
--color-tcb17-bg: oklch(0.965 0.008 180);
--color-tcb17-ink: #2b3a38;
--color-tcb17-ink: oklch(0.33 0.02 180);
--color-tcb17-line: #dbe8e6;
--color-tcb17-line: oklch(0.92 0.012 180);
--color-tcb17-box: #8fb0ab;
--color-tcb17-box: oklch(0.72 0.04 180);
--color-tcb17-acc: #127a70;
--color-tcb17-acc: oklch(0.5 0.1 180);
--font-tcb17-sans: 'Instrument Sans', system-ui, sans-serif;
}
/* 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. */
.tcb-17 {
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+Sans:wght@400;500;600;700&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+Sans:wght@400;500;600;700&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
perspective,transform-style:preserve-3d,backface-visibilityandrotateY(180deg)all became native v4 utilities — no arbitrary properties.- The eight-rule reduced-motion block became five
motion-reduce:utilities on the elements they affect. - UI upgrade from the CSS original: the front face's border turns accent on hover, hinting the flip before it happens.
- UI upgrade: the front border rose from
#b4cbc8(1.6:1) to 3:1 and the accent darkened for 5.3:1 behind the white tick.
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: 3D Flip Checkbox in Tailwind CSS — perspective & backface-hidden
Source: https://codefronts.com/components/tailwind-css-checkboxes/3d-flip-checkbox-tailwind/
Each box is a two-faced card that flips on its Y axis to reveal a filled, ticked back — now using Tailwind v4's native 3D utilities: perspective-[600px], transform-3d, backface-hidden and rotate-y-180. Reduced-motion users get a cross-fade instead.
## HTML
```html
<section class="tcb-17 w-full min-h-svh grid place-items-center bg-tcb17-bg px-5 py-14 font-tcb17-sans text-tcb17-ink selection:bg-tcb17-acc selection:text-white" aria-label="3D flip checkboxes">
<div class="w-full max-w-[25rem] rounded-2xl border border-tcb17-line bg-white px-4 py-2.5">
<label class="group flex min-h-14 cursor-pointer items-center gap-4 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="block size-7 flex-none rounded-lg perspective-[600px] peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb17-acc"><span class="relative block size-full transition-transform duration-500 ease-[cubic-bezier(.4,.8,.3,1)] transform-3d group-has-checked:rotate-y-180 motion-reduce:transition-none motion-reduce:group-has-checked:rotate-y-0"><span class="absolute inset-0 rounded-lg border-2 border-tcb17-box bg-white backface-hidden transition-[border-color,opacity] group-hover:border-tcb17-acc motion-reduce:group-has-checked:opacity-0"></span><span class="absolute inset-0 grid rotate-y-180 place-items-center rounded-lg bg-tcb17-acc text-white backface-hidden motion-reduce:rotate-y-0 motion-reduce:opacity-0 motion-reduce:transition-opacity motion-reduce:group-has-checked:opacity-100"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="size-4"><path d="M20 6 9 17l-5-5"/></svg></span></span></span><span class="text-[15px]">Task complete</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-4 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="block size-7 flex-none rounded-lg perspective-[600px] peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb17-acc"><span class="relative block size-full transition-transform duration-500 ease-[cubic-bezier(.4,.8,.3,1)] transform-3d group-has-checked:rotate-y-180 motion-reduce:transition-none motion-reduce:group-has-checked:rotate-y-0"><span class="absolute inset-0 rounded-lg border-2 border-tcb17-box bg-white backface-hidden transition-[border-color,opacity] group-hover:border-tcb17-acc motion-reduce:group-has-checked:opacity-0"></span><span class="absolute inset-0 grid rotate-y-180 place-items-center rounded-lg bg-tcb17-acc text-white backface-hidden motion-reduce:rotate-y-0 motion-reduce:opacity-0 motion-reduce:transition-opacity motion-reduce:group-has-checked:opacity-100"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="size-4"><path d="M20 6 9 17l-5-5"/></svg></span></span></span><span class="text-[15px]">Mark as read</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-4 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="block size-7 flex-none rounded-lg perspective-[600px] peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb17-acc"><span class="relative block size-full transition-transform duration-500 ease-[cubic-bezier(.4,.8,.3,1)] transform-3d group-has-checked:rotate-y-180 motion-reduce:transition-none motion-reduce:group-has-checked:rotate-y-0"><span class="absolute inset-0 rounded-lg border-2 border-tcb17-box bg-white backface-hidden transition-[border-color,opacity] group-hover:border-tcb17-acc motion-reduce:group-has-checked:opacity-0"></span><span class="absolute inset-0 grid rotate-y-180 place-items-center rounded-lg bg-tcb17-acc text-white backface-hidden motion-reduce:rotate-y-0 motion-reduce:opacity-0 motion-reduce:transition-opacity motion-reduce:group-has-checked:opacity-100"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="size-4"><path d="M20 6 9 17l-5-5"/></svg></span></span></span><span class="text-[15px]">Approve request</span></label>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tcb17-bg: #eef5f4;
--color-tcb17-bg: oklch(0.965 0.008 180);
--color-tcb17-ink: #2b3a38;
--color-tcb17-ink: oklch(0.33 0.02 180);
--color-tcb17-line: #dbe8e6;
--color-tcb17-line: oklch(0.92 0.012 180);
--color-tcb17-box: #8fb0ab;
--color-tcb17-box: oklch(0.72 0.04 180);
--color-tcb17-acc: #127a70;
--color-tcb17-acc: oklch(0.5 0.1 180);
--font-tcb17-sans: 'Instrument Sans', system-ui, sans-serif;
}
/* 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. */
.tcb-17 {
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: 3D Flip Checkbox in Tailwind CSS — perspective & backface-hidden
Source: https://codefronts.com/components/tailwind-css-checkboxes/3d-flip-checkbox-tailwind/
Each box is a two-faced card that flips on its Y axis to reveal a filled, ticked back — now using Tailwind v4's native 3D utilities: perspective-[600px], transform-3d, backface-hidden and rotate-y-180. Reduced-motion users get a cross-fade instead.
## HTML
```html
<section class="tcb-17 w-full min-h-svh grid place-items-center bg-tcb17-bg px-5 py-14 font-tcb17-sans text-tcb17-ink selection:bg-tcb17-acc selection:text-white" aria-label="3D flip checkboxes">
<div class="w-full max-w-[25rem] rounded-2xl border border-tcb17-line bg-white px-4 py-2.5">
<label class="group flex min-h-14 cursor-pointer items-center gap-4 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="block size-7 flex-none rounded-lg perspective-[600px] peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb17-acc"><span class="relative block size-full transition-transform duration-500 ease-[cubic-bezier(.4,.8,.3,1)] transform-3d group-has-checked:rotate-y-180 motion-reduce:transition-none motion-reduce:group-has-checked:rotate-y-0"><span class="absolute inset-0 rounded-lg border-2 border-tcb17-box bg-white backface-hidden transition-[border-color,opacity] group-hover:border-tcb17-acc motion-reduce:group-has-checked:opacity-0"></span><span class="absolute inset-0 grid rotate-y-180 place-items-center rounded-lg bg-tcb17-acc text-white backface-hidden motion-reduce:rotate-y-0 motion-reduce:opacity-0 motion-reduce:transition-opacity motion-reduce:group-has-checked:opacity-100"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="size-4"><path d="M20 6 9 17l-5-5"/></svg></span></span></span><span class="text-[15px]">Task complete</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-4 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="block size-7 flex-none rounded-lg perspective-[600px] peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb17-acc"><span class="relative block size-full transition-transform duration-500 ease-[cubic-bezier(.4,.8,.3,1)] transform-3d group-has-checked:rotate-y-180 motion-reduce:transition-none motion-reduce:group-has-checked:rotate-y-0"><span class="absolute inset-0 rounded-lg border-2 border-tcb17-box bg-white backface-hidden transition-[border-color,opacity] group-hover:border-tcb17-acc motion-reduce:group-has-checked:opacity-0"></span><span class="absolute inset-0 grid rotate-y-180 place-items-center rounded-lg bg-tcb17-acc text-white backface-hidden motion-reduce:rotate-y-0 motion-reduce:opacity-0 motion-reduce:transition-opacity motion-reduce:group-has-checked:opacity-100"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="size-4"><path d="M20 6 9 17l-5-5"/></svg></span></span></span><span class="text-[15px]">Mark as read</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-4 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="block size-7 flex-none rounded-lg perspective-[600px] peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb17-acc"><span class="relative block size-full transition-transform duration-500 ease-[cubic-bezier(.4,.8,.3,1)] transform-3d group-has-checked:rotate-y-180 motion-reduce:transition-none motion-reduce:group-has-checked:rotate-y-0"><span class="absolute inset-0 rounded-lg border-2 border-tcb17-box bg-white backface-hidden transition-[border-color,opacity] group-hover:border-tcb17-acc motion-reduce:group-has-checked:opacity-0"></span><span class="absolute inset-0 grid rotate-y-180 place-items-center rounded-lg bg-tcb17-acc text-white backface-hidden motion-reduce:rotate-y-0 motion-reduce:opacity-0 motion-reduce:transition-opacity motion-reduce:group-has-checked:opacity-100"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="size-4"><path d="M20 6 9 17l-5-5"/></svg></span></span></span><span class="text-[15px]">Approve request</span></label>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tcb17-bg: #eef5f4;
--color-tcb17-bg: oklch(0.965 0.008 180);
--color-tcb17-ink: #2b3a38;
--color-tcb17-ink: oklch(0.33 0.02 180);
--color-tcb17-line: #dbe8e6;
--color-tcb17-line: oklch(0.92 0.012 180);
--color-tcb17-box: #8fb0ab;
--color-tcb17-box: oklch(0.72 0.04 180);
--color-tcb17-acc: #127a70;
--color-tcb17-acc: oklch(0.5 0.1 180);
--font-tcb17-sans: 'Instrument Sans', system-ui, sans-serif;
}
/* 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. */
.tcb-17 {
width: 100%;
min-height: 100svh;
}
```How this works
Three layers. The box sets the camera (perspective); the inner card keeps its children in 3D space (transform-3d); each face hides its back (backface-hidden). The back face starts pre-rotated 180°, so flipping the card shows it.
v4 made this utility-first. In v3 every one of these was an arbitrary property; v4 ships them as first-class utilities.
Reduced motion. The card stays still and the faces cross-fade via opacity.
Make it yours
- Vertical flip:
rotate-x-180on the back and in the checked state. - Stronger depth:
perspective-[300px]. - Back face content: swap the tick for an icon or count.
- Timing:
duration-500with theease-[cubic-bezier(.4,.8,.3,1)]curve.
Gotchas — read before shipping
overflow-hiddenon any ancestor flattens 3D in some engines — keep it off the card.- Safari needs
backface-hiddenon each face, not the parent. - Focus ring sits on the outer box, which doesn't rotate.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
3D transforms are universal; rotate-y-* compiles to transform: … rotateY().