18 / 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
Material Ripple Checkbox in Tailwind CSS — State Layer & Wave
Material-style checkboxes with the halo done right: a 40px circular state layer sits behind the box, tints on hover and focus, and emits a ripple (group-has-checked:animate-tcb18-ripple) that escapes the box instead of being clipped inside it.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<section class="tcb-18 w-full min-h-svh grid place-items-center bg-tcb18-bg px-5 py-14 font-tcb18-sans text-tcb18-ink selection:bg-tcb18-acc selection:text-white" aria-label="Ripple wave checkboxes">
<div class="w-full max-w-[25rem] rounded-2xl border border-tcb18-line bg-white px-3 py-2">
<label class="group flex min-h-14 cursor-pointer items-center gap-2 pr-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="relative grid size-10 flex-none place-items-center rounded-full transition-colors group-hover:bg-tcb18-acc/8 group-has-focus-visible:bg-tcb18-acc/12 peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb18-acc"><span class="absolute inset-0 scale-0 rounded-full bg-tcb18-acc opacity-0 group-has-checked:animate-tcb18-ripple motion-reduce:hidden"></span><span class="relative grid size-5 place-items-center rounded-[4px] border-2 border-tcb18-box bg-white text-white transition-colors duration-200 group-has-checked:border-tcb18-acc group-has-checked:bg-tcb18-acc"><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-3.5 scale-50 opacity-0 transition duration-200 ease-[cubic-bezier(.2,.9,.3,1.2)] group-has-checked:scale-100 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span></span><span class="text-[15px]">Sync across devices</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-2 pr-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-10 flex-none place-items-center rounded-full transition-colors group-hover:bg-tcb18-acc/8 group-has-focus-visible:bg-tcb18-acc/12 peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb18-acc"><span class="absolute inset-0 scale-0 rounded-full bg-tcb18-acc opacity-0 group-has-checked:animate-tcb18-ripple motion-reduce:hidden"></span><span class="relative grid size-5 place-items-center rounded-[4px] border-2 border-tcb18-box bg-white text-white transition-colors duration-200 group-has-checked:border-tcb18-acc group-has-checked:bg-tcb18-acc"><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-3.5 scale-50 opacity-0 transition duration-200 ease-[cubic-bezier(.2,.9,.3,1.2)] group-has-checked:scale-100 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span></span><span class="text-[15px]">Offline downloads</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-2 pr-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-10 flex-none place-items-center rounded-full transition-colors group-hover:bg-tcb18-acc/8 group-has-focus-visible:bg-tcb18-acc/12 peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb18-acc"><span class="absolute inset-0 scale-0 rounded-full bg-tcb18-acc opacity-0 group-has-checked:animate-tcb18-ripple motion-reduce:hidden"></span><span class="relative grid size-5 place-items-center rounded-[4px] border-2 border-tcb18-box bg-white text-white transition-colors duration-200 group-has-checked:border-tcb18-acc group-has-checked:bg-tcb18-acc"><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-3.5 scale-50 opacity-0 transition duration-200 ease-[cubic-bezier(.2,.9,.3,1.2)] group-has-checked:scale-100 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span></span><span class="text-[15px]">Background refresh</span></label>
</div>
</section><section class="tcb-18 w-full min-h-svh grid place-items-center bg-tcb18-bg px-5 py-14 font-tcb18-sans text-tcb18-ink selection:bg-tcb18-acc selection:text-white" aria-label="Ripple wave checkboxes">
<div class="w-full max-w-[25rem] rounded-2xl border border-tcb18-line bg-white px-3 py-2">
<label class="group flex min-h-14 cursor-pointer items-center gap-2 pr-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="relative grid size-10 flex-none place-items-center rounded-full transition-colors group-hover:bg-tcb18-acc/8 group-has-focus-visible:bg-tcb18-acc/12 peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb18-acc"><span class="absolute inset-0 scale-0 rounded-full bg-tcb18-acc opacity-0 group-has-checked:animate-tcb18-ripple motion-reduce:hidden"></span><span class="relative grid size-5 place-items-center rounded-[4px] border-2 border-tcb18-box bg-white text-white transition-colors duration-200 group-has-checked:border-tcb18-acc group-has-checked:bg-tcb18-acc"><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-3.5 scale-50 opacity-0 transition duration-200 ease-[cubic-bezier(.2,.9,.3,1.2)] group-has-checked:scale-100 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span></span><span class="text-[15px]">Sync across devices</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-2 pr-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-10 flex-none place-items-center rounded-full transition-colors group-hover:bg-tcb18-acc/8 group-has-focus-visible:bg-tcb18-acc/12 peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb18-acc"><span class="absolute inset-0 scale-0 rounded-full bg-tcb18-acc opacity-0 group-has-checked:animate-tcb18-ripple motion-reduce:hidden"></span><span class="relative grid size-5 place-items-center rounded-[4px] border-2 border-tcb18-box bg-white text-white transition-colors duration-200 group-has-checked:border-tcb18-acc group-has-checked:bg-tcb18-acc"><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-3.5 scale-50 opacity-0 transition duration-200 ease-[cubic-bezier(.2,.9,.3,1.2)] group-has-checked:scale-100 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span></span><span class="text-[15px]">Offline downloads</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-2 pr-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-10 flex-none place-items-center rounded-full transition-colors group-hover:bg-tcb18-acc/8 group-has-focus-visible:bg-tcb18-acc/12 peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb18-acc"><span class="absolute inset-0 scale-0 rounded-full bg-tcb18-acc opacity-0 group-has-checked:animate-tcb18-ripple motion-reduce:hidden"></span><span class="relative grid size-5 place-items-center rounded-[4px] border-2 border-tcb18-box bg-white text-white transition-colors duration-200 group-has-checked:border-tcb18-acc group-has-checked:bg-tcb18-acc"><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-3.5 scale-50 opacity-0 transition duration-200 ease-[cubic-bezier(.2,.9,.3,1.2)] group-has-checked:scale-100 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span></span><span class="text-[15px]">Background refresh</span></label>
</div>
</section>@import "tailwindcss";
@theme {
--color-tcb18-bg: #f4f5fa;
--color-tcb18-bg: oklch(0.97 0.006 275);
--color-tcb18-ink: #2c3040;
--color-tcb18-ink: oklch(0.3 0.025 275);
--color-tcb18-line: #e5e7f0;
--color-tcb18-line: oklch(0.925 0.01 275);
--color-tcb18-box: #6f7690;
--color-tcb18-box: oklch(0.56 0.04 275);
--color-tcb18-acc: #4c5fd5;
--color-tcb18-acc: oklch(0.54 0.18 270);
--font-tcb18-sans: 'DM Sans', system-ui, sans-serif;
--animate-tcb18-ripple: tcb18-ripple 0.55s ease-out;
@keyframes tcb18-ripple {
from {
scale: 0.4;
opacity: 0.3;
}
to {
scale: 1.25;
opacity: 0;
}
}
}
/* 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-18 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-tcb18-bg: #f4f5fa;
--color-tcb18-bg: oklch(0.97 0.006 275);
--color-tcb18-ink: #2c3040;
--color-tcb18-ink: oklch(0.3 0.025 275);
--color-tcb18-line: #e5e7f0;
--color-tcb18-line: oklch(0.925 0.01 275);
--color-tcb18-box: #6f7690;
--color-tcb18-box: oklch(0.56 0.04 275);
--color-tcb18-acc: #4c5fd5;
--color-tcb18-acc: oklch(0.54 0.18 270);
--font-tcb18-sans: 'DM Sans', system-ui, sans-serif;
--animate-tcb18-ripple: tcb18-ripple 0.55s ease-out;
@keyframes tcb18-ripple {
from {
scale: 0.4;
opacity: 0.3;
}
to {
scale: 1.25;
opacity: 0;
}
}
}
/* 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-18 {
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-tcb18-bg: #f4f5fa;
--color-tcb18-bg: oklch(0.97 0.006 275);
--color-tcb18-ink: #2c3040;
--color-tcb18-ink: oklch(0.3 0.025 275);
--color-tcb18-line: #e5e7f0;
--color-tcb18-line: oklch(0.925 0.01 275);
--color-tcb18-box: #6f7690;
--color-tcb18-box: oklch(0.56 0.04 275);
--color-tcb18-acc: #4c5fd5;
--color-tcb18-acc: oklch(0.54 0.18 270);
--font-tcb18-sans: 'DM Sans', system-ui, sans-serif;
--animate-tcb18-ripple: tcb18-ripple 0.55s ease-out;
@keyframes tcb18-ripple {
from {
scale: 0.4;
opacity: 0.3;
}
to {
scale: 1.25;
opacity: 0;
}
}
}
/* 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-18 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-tcb18-bg: #f4f5fa;
--color-tcb18-bg: oklch(0.97 0.006 275);
--color-tcb18-ink: #2c3040;
--color-tcb18-ink: oklch(0.3 0.025 275);
--color-tcb18-line: #e5e7f0;
--color-tcb18-line: oklch(0.925 0.01 275);
--color-tcb18-box: #6f7690;
--color-tcb18-box: oklch(0.56 0.04 275);
--color-tcb18-acc: #4c5fd5;
--color-tcb18-acc: oklch(0.54 0.18 270);
--font-tcb18-sans: 'DM Sans', system-ui, sans-serif;
--animate-tcb18-ripple: tcb18-ripple 0.55s ease-out;
@keyframes tcb18-ripple {
from {
scale: 0.4;
opacity: 0.3;
}
to {
scale: 1.25;
opacity: 0;
}
}
}
/* 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-18 {
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=DM+Sans:opsz,wght@9..40,400..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=DM+Sans:opsz,wght@9..40,400..700&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
transform:translate(-50%,-50%) scale(…)inside the keyframes became plainscale— the layer is centred by grid, not transforms..ripple{display:none}under reduced motion becamemotion-reduce:hidden.- UI upgrade from the CSS original: the ripple moved out of the clipped box into a Material-style 40px state layer, so it's actually visible; hover and keyboard focus now tint that layer (8% / 12%).
- UI upgrade: the unchecked border darkened from
#b9bfd4(1.8:1) to Material's on-surface-variant weight (4.6:1).
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: Material Ripple Checkbox in Tailwind CSS — State Layer & Wave
Source: https://codefronts.com/components/tailwind-css-checkboxes/material-ripple-checkbox-tailwind/
Material-style checkboxes with the halo done right: a 40px circular state layer sits behind the box, tints on hover and focus, and emits a ripple (group-has-checked:animate-tcb18-ripple) that escapes the box instead of being clipped inside it.
## HTML
```html
<section class="tcb-18 w-full min-h-svh grid place-items-center bg-tcb18-bg px-5 py-14 font-tcb18-sans text-tcb18-ink selection:bg-tcb18-acc selection:text-white" aria-label="Ripple wave checkboxes">
<div class="w-full max-w-[25rem] rounded-2xl border border-tcb18-line bg-white px-3 py-2">
<label class="group flex min-h-14 cursor-pointer items-center gap-2 pr-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="relative grid size-10 flex-none place-items-center rounded-full transition-colors group-hover:bg-tcb18-acc/8 group-has-focus-visible:bg-tcb18-acc/12 peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb18-acc"><span class="absolute inset-0 scale-0 rounded-full bg-tcb18-acc opacity-0 group-has-checked:animate-tcb18-ripple motion-reduce:hidden"></span><span class="relative grid size-5 place-items-center rounded-[4px] border-2 border-tcb18-box bg-white text-white transition-colors duration-200 group-has-checked:border-tcb18-acc group-has-checked:bg-tcb18-acc"><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-3.5 scale-50 opacity-0 transition duration-200 ease-[cubic-bezier(.2,.9,.3,1.2)] group-has-checked:scale-100 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span></span><span class="text-[15px]">Sync across devices</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-2 pr-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-10 flex-none place-items-center rounded-full transition-colors group-hover:bg-tcb18-acc/8 group-has-focus-visible:bg-tcb18-acc/12 peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb18-acc"><span class="absolute inset-0 scale-0 rounded-full bg-tcb18-acc opacity-0 group-has-checked:animate-tcb18-ripple motion-reduce:hidden"></span><span class="relative grid size-5 place-items-center rounded-[4px] border-2 border-tcb18-box bg-white text-white transition-colors duration-200 group-has-checked:border-tcb18-acc group-has-checked:bg-tcb18-acc"><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-3.5 scale-50 opacity-0 transition duration-200 ease-[cubic-bezier(.2,.9,.3,1.2)] group-has-checked:scale-100 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span></span><span class="text-[15px]">Offline downloads</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-2 pr-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-10 flex-none place-items-center rounded-full transition-colors group-hover:bg-tcb18-acc/8 group-has-focus-visible:bg-tcb18-acc/12 peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb18-acc"><span class="absolute inset-0 scale-0 rounded-full bg-tcb18-acc opacity-0 group-has-checked:animate-tcb18-ripple motion-reduce:hidden"></span><span class="relative grid size-5 place-items-center rounded-[4px] border-2 border-tcb18-box bg-white text-white transition-colors duration-200 group-has-checked:border-tcb18-acc group-has-checked:bg-tcb18-acc"><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-3.5 scale-50 opacity-0 transition duration-200 ease-[cubic-bezier(.2,.9,.3,1.2)] group-has-checked:scale-100 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span></span><span class="text-[15px]">Background refresh</span></label>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tcb18-bg: #f4f5fa;
--color-tcb18-bg: oklch(0.97 0.006 275);
--color-tcb18-ink: #2c3040;
--color-tcb18-ink: oklch(0.3 0.025 275);
--color-tcb18-line: #e5e7f0;
--color-tcb18-line: oklch(0.925 0.01 275);
--color-tcb18-box: #6f7690;
--color-tcb18-box: oklch(0.56 0.04 275);
--color-tcb18-acc: #4c5fd5;
--color-tcb18-acc: oklch(0.54 0.18 270);
--font-tcb18-sans: 'DM Sans', system-ui, sans-serif;
--animate-tcb18-ripple: tcb18-ripple 0.55s ease-out;
@keyframes tcb18-ripple {
from {
scale: 0.4;
opacity: 0.3;
}
to {
scale: 1.25;
opacity: 0;
}
}
}
/* 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-18 {
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: Material Ripple Checkbox in Tailwind CSS — State Layer & Wave
Source: https://codefronts.com/components/tailwind-css-checkboxes/material-ripple-checkbox-tailwind/
Material-style checkboxes with the halo done right: a 40px circular state layer sits behind the box, tints on hover and focus, and emits a ripple (group-has-checked:animate-tcb18-ripple) that escapes the box instead of being clipped inside it.
## HTML
```html
<section class="tcb-18 w-full min-h-svh grid place-items-center bg-tcb18-bg px-5 py-14 font-tcb18-sans text-tcb18-ink selection:bg-tcb18-acc selection:text-white" aria-label="Ripple wave checkboxes">
<div class="w-full max-w-[25rem] rounded-2xl border border-tcb18-line bg-white px-3 py-2">
<label class="group flex min-h-14 cursor-pointer items-center gap-2 pr-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="relative grid size-10 flex-none place-items-center rounded-full transition-colors group-hover:bg-tcb18-acc/8 group-has-focus-visible:bg-tcb18-acc/12 peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb18-acc"><span class="absolute inset-0 scale-0 rounded-full bg-tcb18-acc opacity-0 group-has-checked:animate-tcb18-ripple motion-reduce:hidden"></span><span class="relative grid size-5 place-items-center rounded-[4px] border-2 border-tcb18-box bg-white text-white transition-colors duration-200 group-has-checked:border-tcb18-acc group-has-checked:bg-tcb18-acc"><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-3.5 scale-50 opacity-0 transition duration-200 ease-[cubic-bezier(.2,.9,.3,1.2)] group-has-checked:scale-100 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span></span><span class="text-[15px]">Sync across devices</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-2 pr-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-10 flex-none place-items-center rounded-full transition-colors group-hover:bg-tcb18-acc/8 group-has-focus-visible:bg-tcb18-acc/12 peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb18-acc"><span class="absolute inset-0 scale-0 rounded-full bg-tcb18-acc opacity-0 group-has-checked:animate-tcb18-ripple motion-reduce:hidden"></span><span class="relative grid size-5 place-items-center rounded-[4px] border-2 border-tcb18-box bg-white text-white transition-colors duration-200 group-has-checked:border-tcb18-acc group-has-checked:bg-tcb18-acc"><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-3.5 scale-50 opacity-0 transition duration-200 ease-[cubic-bezier(.2,.9,.3,1.2)] group-has-checked:scale-100 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span></span><span class="text-[15px]">Offline downloads</span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-2 pr-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-10 flex-none place-items-center rounded-full transition-colors group-hover:bg-tcb18-acc/8 group-has-focus-visible:bg-tcb18-acc/12 peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb18-acc"><span class="absolute inset-0 scale-0 rounded-full bg-tcb18-acc opacity-0 group-has-checked:animate-tcb18-ripple motion-reduce:hidden"></span><span class="relative grid size-5 place-items-center rounded-[4px] border-2 border-tcb18-box bg-white text-white transition-colors duration-200 group-has-checked:border-tcb18-acc group-has-checked:bg-tcb18-acc"><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-3.5 scale-50 opacity-0 transition duration-200 ease-[cubic-bezier(.2,.9,.3,1.2)] group-has-checked:scale-100 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span></span><span class="text-[15px]">Background refresh</span></label>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tcb18-bg: #f4f5fa;
--color-tcb18-bg: oklch(0.97 0.006 275);
--color-tcb18-ink: #2c3040;
--color-tcb18-ink: oklch(0.3 0.025 275);
--color-tcb18-line: #e5e7f0;
--color-tcb18-line: oklch(0.925 0.01 275);
--color-tcb18-box: #6f7690;
--color-tcb18-box: oklch(0.56 0.04 275);
--color-tcb18-acc: #4c5fd5;
--color-tcb18-acc: oklch(0.54 0.18 270);
--font-tcb18-sans: 'DM Sans', system-ui, sans-serif;
--animate-tcb18-ripple: tcb18-ripple 0.55s ease-out;
@keyframes tcb18-ripple {
from {
scale: 0.4;
opacity: 0.3;
}
to {
scale: 1.25;
opacity: 0;
}
}
}
/* 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-18 {
width: 100%;
min-height: 100svh;
}
```How this works
Ripples belong outside. The original placed the ripple inside the box with overflow:hidden, so it was a 26px flash under a solid fill — effectively invisible. Material places a circular state layer around the control; the ripple now expands from there.
v4 scale. The keyframes animate the standalone scale property, so they don't have to repeat the translate(-50%,-50%) centring the original needed.
Make it yours
- Material 3 sizing:
size-[18px]box,size-10layer. - Colour:
--color-tcb18-accdrives layer, ripple and fill. - Stronger ripple:
opacity: 0.35in the keyframe's start. - Error state:
aria-invalid:with a red token.
Gotchas — read before shipping
- The ripple fires on check only; for a ripple on uncheck, add a second animation on the unchecked state.
- Initially-checked boxes ripple on load.
- Reduced motion hides the ripple but keeps the hover state layer.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
The individual scale property needs Chrome 104 / Safari 14.1 / Firefox 72.