13 / 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
Liquid Fill Checkbox Animation in Tailwind CSS — Water Wave
Water rises into the box on check: an oversized, wavy-topped blob slides up from translate-y-[105%] to group-has-checked:translate-y-0, then keeps sloshing with animate-tcb13-wave. Hovering an empty box now lets the water peek in, previewing the action.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<section class="tcb-13 w-full min-h-svh grid place-items-center bg-tcb13-bg px-5 py-14 font-tcb13-sans text-tcb13-ink selection:bg-tcb13-water selection:text-white" aria-label="Liquid fill checkboxes">
<div class="w-full max-w-[25rem] rounded-2xl border border-tcb13-line bg-white px-4 py-2.5">
<label class="group flex min-h-15 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="relative grid size-7 flex-none place-items-center overflow-hidden rounded-lg border-2 border-tcb13-box bg-white text-white transition-colors duration-300 peer-checked:border-tcb13-water peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb13-water"><span class="absolute -left-1/4 bottom-0 h-[130%] w-[150%] translate-y-[105%] rounded-[42%_46%_0_0/14px] bg-tcb13-water transition-transform duration-500 ease-[cubic-bezier(.5,.1,.3,1)] group-hover:translate-y-[78%] group-has-checked:translate-y-0 group-has-checked:animate-tcb13-wave motion-reduce:animate-none motion-reduce:transition-none"></span><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="relative z-10 size-[15px] opacity-0 transition-opacity delay-180 duration-250 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span><span><span class="block text-[15px] font-medium">Drink water</span><span class="block text-[13px] text-tcb13-mut">2 litres</span></span></label>
<label class="group flex min-h-15 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-7 flex-none place-items-center overflow-hidden rounded-lg border-2 border-tcb13-box bg-white text-white transition-colors duration-300 peer-checked:border-tcb13-water peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb13-water"><span class="absolute -left-1/4 bottom-0 h-[130%] w-[150%] translate-y-[105%] rounded-[42%_46%_0_0/14px] bg-tcb13-water transition-transform duration-500 ease-[cubic-bezier(.5,.1,.3,1)] group-hover:translate-y-[78%] group-has-checked:translate-y-0 group-has-checked:animate-tcb13-wave motion-reduce:animate-none motion-reduce:transition-none"></span><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="relative z-10 size-[15px] opacity-0 transition-opacity delay-180 duration-250 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span><span><span class="block text-[15px] font-medium">Morning workout</span><span class="block text-[13px] text-tcb13-mut">30 minutes</span></span></label>
<label class="group flex min-h-15 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-7 flex-none place-items-center overflow-hidden rounded-lg border-2 border-tcb13-box bg-white text-white transition-colors duration-300 peer-checked:border-tcb13-water peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb13-water"><span class="absolute -left-1/4 bottom-0 h-[130%] w-[150%] translate-y-[105%] rounded-[42%_46%_0_0/14px] bg-tcb13-water transition-transform duration-500 ease-[cubic-bezier(.5,.1,.3,1)] group-hover:translate-y-[78%] group-has-checked:translate-y-0 group-has-checked:animate-tcb13-wave motion-reduce:animate-none motion-reduce:transition-none"></span><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="relative z-10 size-[15px] opacity-0 transition-opacity delay-180 duration-250 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span><span><span class="block text-[15px] font-medium">Read 20 pages</span><span class="block text-[13px] text-tcb13-mut">Before bed</span></span></label>
</div>
</section><section class="tcb-13 w-full min-h-svh grid place-items-center bg-tcb13-bg px-5 py-14 font-tcb13-sans text-tcb13-ink selection:bg-tcb13-water selection:text-white" aria-label="Liquid fill checkboxes">
<div class="w-full max-w-[25rem] rounded-2xl border border-tcb13-line bg-white px-4 py-2.5">
<label class="group flex min-h-15 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="relative grid size-7 flex-none place-items-center overflow-hidden rounded-lg border-2 border-tcb13-box bg-white text-white transition-colors duration-300 peer-checked:border-tcb13-water peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb13-water"><span class="absolute -left-1/4 bottom-0 h-[130%] w-[150%] translate-y-[105%] rounded-[42%_46%_0_0/14px] bg-tcb13-water transition-transform duration-500 ease-[cubic-bezier(.5,.1,.3,1)] group-hover:translate-y-[78%] group-has-checked:translate-y-0 group-has-checked:animate-tcb13-wave motion-reduce:animate-none motion-reduce:transition-none"></span><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="relative z-10 size-[15px] opacity-0 transition-opacity delay-180 duration-250 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span><span><span class="block text-[15px] font-medium">Drink water</span><span class="block text-[13px] text-tcb13-mut">2 litres</span></span></label>
<label class="group flex min-h-15 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-7 flex-none place-items-center overflow-hidden rounded-lg border-2 border-tcb13-box bg-white text-white transition-colors duration-300 peer-checked:border-tcb13-water peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb13-water"><span class="absolute -left-1/4 bottom-0 h-[130%] w-[150%] translate-y-[105%] rounded-[42%_46%_0_0/14px] bg-tcb13-water transition-transform duration-500 ease-[cubic-bezier(.5,.1,.3,1)] group-hover:translate-y-[78%] group-has-checked:translate-y-0 group-has-checked:animate-tcb13-wave motion-reduce:animate-none motion-reduce:transition-none"></span><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="relative z-10 size-[15px] opacity-0 transition-opacity delay-180 duration-250 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span><span><span class="block text-[15px] font-medium">Morning workout</span><span class="block text-[13px] text-tcb13-mut">30 minutes</span></span></label>
<label class="group flex min-h-15 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-7 flex-none place-items-center overflow-hidden rounded-lg border-2 border-tcb13-box bg-white text-white transition-colors duration-300 peer-checked:border-tcb13-water peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb13-water"><span class="absolute -left-1/4 bottom-0 h-[130%] w-[150%] translate-y-[105%] rounded-[42%_46%_0_0/14px] bg-tcb13-water transition-transform duration-500 ease-[cubic-bezier(.5,.1,.3,1)] group-hover:translate-y-[78%] group-has-checked:translate-y-0 group-has-checked:animate-tcb13-wave motion-reduce:animate-none motion-reduce:transition-none"></span><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="relative z-10 size-[15px] opacity-0 transition-opacity delay-180 duration-250 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span><span><span class="block text-[15px] font-medium">Read 20 pages</span><span class="block text-[13px] text-tcb13-mut">Before bed</span></span></label>
</div>
</section>@import "tailwindcss";
@theme {
--color-tcb13-bg: #eef4f8;
--color-tcb13-bg: oklch(0.96 0.008 235);
--color-tcb13-ink: #2c3a44;
--color-tcb13-ink: oklch(0.33 0.025 240);
--color-tcb13-mut: #566873;
--color-tcb13-mut: oklch(0.49 0.025 235);
--color-tcb13-line: #dce6ee;
--color-tcb13-line: oklch(0.92 0.012 240);
--color-tcb13-box: #8ea6b6;
--color-tcb13-box: oklch(0.7 0.035 235);
--color-tcb13-water: #2b86c4;
--color-tcb13-water: oklch(0.58 0.13 240);
--font-tcb13-sans: 'Outfit', system-ui, sans-serif;
--animate-tcb13-wave: tcb13-wave 3s linear infinite;
@keyframes tcb13-wave {
0%,
100% {
border-radius: 42% 46% 0 0 / 14px;
}
50% {
border-radius: 46% 40% 0 0 / 12px;
}
}
}
/* 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-13 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-tcb13-bg: #eef4f8;
--color-tcb13-bg: oklch(0.96 0.008 235);
--color-tcb13-ink: #2c3a44;
--color-tcb13-ink: oklch(0.33 0.025 240);
--color-tcb13-mut: #566873;
--color-tcb13-mut: oklch(0.49 0.025 235);
--color-tcb13-line: #dce6ee;
--color-tcb13-line: oklch(0.92 0.012 240);
--color-tcb13-box: #8ea6b6;
--color-tcb13-box: oklch(0.7 0.035 235);
--color-tcb13-water: #2b86c4;
--color-tcb13-water: oklch(0.58 0.13 240);
--font-tcb13-sans: 'Outfit', system-ui, sans-serif;
--animate-tcb13-wave: tcb13-wave 3s linear infinite;
@keyframes tcb13-wave {
0%,
100% {
border-radius: 42% 46% 0 0 / 14px;
}
50% {
border-radius: 46% 40% 0 0 / 12px;
}
}
}
/* 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-13 {
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-tcb13-bg: #eef4f8;
--color-tcb13-bg: oklch(0.96 0.008 235);
--color-tcb13-ink: #2c3a44;
--color-tcb13-ink: oklch(0.33 0.025 240);
--color-tcb13-mut: #566873;
--color-tcb13-mut: oklch(0.49 0.025 235);
--color-tcb13-line: #dce6ee;
--color-tcb13-line: oklch(0.92 0.012 240);
--color-tcb13-box: #8ea6b6;
--color-tcb13-box: oklch(0.7 0.035 235);
--color-tcb13-water: #2b86c4;
--color-tcb13-water: oklch(0.58 0.13 240);
--font-tcb13-sans: 'Outfit', system-ui, sans-serif;
--animate-tcb13-wave: tcb13-wave 3s linear infinite;
@keyframes tcb13-wave {
0%,
100% {
border-radius: 42% 46% 0 0 / 14px;
}
50% {
border-radius: 46% 40% 0 0 / 12px;
}
}
}
/* 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-13 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-tcb13-bg: #eef4f8;
--color-tcb13-bg: oklch(0.96 0.008 235);
--color-tcb13-ink: #2c3a44;
--color-tcb13-ink: oklch(0.33 0.025 240);
--color-tcb13-mut: #566873;
--color-tcb13-mut: oklch(0.49 0.025 235);
--color-tcb13-line: #dce6ee;
--color-tcb13-line: oklch(0.92 0.012 240);
--color-tcb13-box: #8ea6b6;
--color-tcb13-box: oklch(0.7 0.035 235);
--color-tcb13-water: #2b86c4;
--color-tcb13-water: oklch(0.58 0.13 240);
--font-tcb13-sans: 'Outfit', system-ui, sans-serif;
--animate-tcb13-wave: tcb13-wave 3s linear infinite;
@keyframes tcb13-wave {
0%,
100% {
border-radius: 42% 46% 0 0 / 14px;
}
50% {
border-radius: 46% 40% 0 0 / 12px;
}
}
}
/* 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-13 {
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=Outfit: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=Outfit:wght@400;500;600;700&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
.liquid{border-radius:42% 46% 0 0/14px;transform:translateY(105%)}becamerounded-[42%_46%_0_0/14px] translate-y-[105%]— underscores are spaces.- The
::aftertick withtransition:opacity .25s .18sbecame an SVG withdelay-180 duration-250. - UI upgrade from the CSS original: hovering an empty box lets the water peek in (
group-hover:translate-y-[78%]), previewing the action; rows gained a goal caption. - UI upgrade: the empty border rose from
#b9cad6(1.7:1) to 3: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: Liquid Fill Checkbox Animation in Tailwind CSS — Water Wave
Source: https://codefronts.com/components/tailwind-css-checkboxes/liquid-fill-checkbox-tailwind-water-wave/
Water rises into the box on check: an oversized, wavy-topped blob slides up from translate-y-[105%] to group-has-checked:translate-y-0, then keeps sloshing with animate-tcb13-wave. Hovering an empty box now lets the water peek in, previewing the action.
## HTML
```html
<section class="tcb-13 w-full min-h-svh grid place-items-center bg-tcb13-bg px-5 py-14 font-tcb13-sans text-tcb13-ink selection:bg-tcb13-water selection:text-white" aria-label="Liquid fill checkboxes">
<div class="w-full max-w-[25rem] rounded-2xl border border-tcb13-line bg-white px-4 py-2.5">
<label class="group flex min-h-15 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="relative grid size-7 flex-none place-items-center overflow-hidden rounded-lg border-2 border-tcb13-box bg-white text-white transition-colors duration-300 peer-checked:border-tcb13-water peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb13-water"><span class="absolute -left-1/4 bottom-0 h-[130%] w-[150%] translate-y-[105%] rounded-[42%_46%_0_0/14px] bg-tcb13-water transition-transform duration-500 ease-[cubic-bezier(.5,.1,.3,1)] group-hover:translate-y-[78%] group-has-checked:translate-y-0 group-has-checked:animate-tcb13-wave motion-reduce:animate-none motion-reduce:transition-none"></span><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="relative z-10 size-[15px] opacity-0 transition-opacity delay-180 duration-250 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span><span><span class="block text-[15px] font-medium">Drink water</span><span class="block text-[13px] text-tcb13-mut">2 litres</span></span></label>
<label class="group flex min-h-15 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-7 flex-none place-items-center overflow-hidden rounded-lg border-2 border-tcb13-box bg-white text-white transition-colors duration-300 peer-checked:border-tcb13-water peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb13-water"><span class="absolute -left-1/4 bottom-0 h-[130%] w-[150%] translate-y-[105%] rounded-[42%_46%_0_0/14px] bg-tcb13-water transition-transform duration-500 ease-[cubic-bezier(.5,.1,.3,1)] group-hover:translate-y-[78%] group-has-checked:translate-y-0 group-has-checked:animate-tcb13-wave motion-reduce:animate-none motion-reduce:transition-none"></span><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="relative z-10 size-[15px] opacity-0 transition-opacity delay-180 duration-250 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span><span><span class="block text-[15px] font-medium">Morning workout</span><span class="block text-[13px] text-tcb13-mut">30 minutes</span></span></label>
<label class="group flex min-h-15 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-7 flex-none place-items-center overflow-hidden rounded-lg border-2 border-tcb13-box bg-white text-white transition-colors duration-300 peer-checked:border-tcb13-water peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb13-water"><span class="absolute -left-1/4 bottom-0 h-[130%] w-[150%] translate-y-[105%] rounded-[42%_46%_0_0/14px] bg-tcb13-water transition-transform duration-500 ease-[cubic-bezier(.5,.1,.3,1)] group-hover:translate-y-[78%] group-has-checked:translate-y-0 group-has-checked:animate-tcb13-wave motion-reduce:animate-none motion-reduce:transition-none"></span><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="relative z-10 size-[15px] opacity-0 transition-opacity delay-180 duration-250 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span><span><span class="block text-[15px] font-medium">Read 20 pages</span><span class="block text-[13px] text-tcb13-mut">Before bed</span></span></label>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tcb13-bg: #eef4f8;
--color-tcb13-bg: oklch(0.96 0.008 235);
--color-tcb13-ink: #2c3a44;
--color-tcb13-ink: oklch(0.33 0.025 240);
--color-tcb13-mut: #566873;
--color-tcb13-mut: oklch(0.49 0.025 235);
--color-tcb13-line: #dce6ee;
--color-tcb13-line: oklch(0.92 0.012 240);
--color-tcb13-box: #8ea6b6;
--color-tcb13-box: oklch(0.7 0.035 235);
--color-tcb13-water: #2b86c4;
--color-tcb13-water: oklch(0.58 0.13 240);
--font-tcb13-sans: 'Outfit', system-ui, sans-serif;
--animate-tcb13-wave: tcb13-wave 3s linear infinite;
@keyframes tcb13-wave {
0%,
100% {
border-radius: 42% 46% 0 0 / 14px;
}
50% {
border-radius: 46% 40% 0 0 / 12px;
}
}
}
/* 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-13 {
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: Liquid Fill Checkbox Animation in Tailwind CSS — Water Wave
Source: https://codefronts.com/components/tailwind-css-checkboxes/liquid-fill-checkbox-tailwind-water-wave/
Water rises into the box on check: an oversized, wavy-topped blob slides up from translate-y-[105%] to group-has-checked:translate-y-0, then keeps sloshing with animate-tcb13-wave. Hovering an empty box now lets the water peek in, previewing the action.
## HTML
```html
<section class="tcb-13 w-full min-h-svh grid place-items-center bg-tcb13-bg px-5 py-14 font-tcb13-sans text-tcb13-ink selection:bg-tcb13-water selection:text-white" aria-label="Liquid fill checkboxes">
<div class="w-full max-w-[25rem] rounded-2xl border border-tcb13-line bg-white px-4 py-2.5">
<label class="group flex min-h-15 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="relative grid size-7 flex-none place-items-center overflow-hidden rounded-lg border-2 border-tcb13-box bg-white text-white transition-colors duration-300 peer-checked:border-tcb13-water peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb13-water"><span class="absolute -left-1/4 bottom-0 h-[130%] w-[150%] translate-y-[105%] rounded-[42%_46%_0_0/14px] bg-tcb13-water transition-transform duration-500 ease-[cubic-bezier(.5,.1,.3,1)] group-hover:translate-y-[78%] group-has-checked:translate-y-0 group-has-checked:animate-tcb13-wave motion-reduce:animate-none motion-reduce:transition-none"></span><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="relative z-10 size-[15px] opacity-0 transition-opacity delay-180 duration-250 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span><span><span class="block text-[15px] font-medium">Drink water</span><span class="block text-[13px] text-tcb13-mut">2 litres</span></span></label>
<label class="group flex min-h-15 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-7 flex-none place-items-center overflow-hidden rounded-lg border-2 border-tcb13-box bg-white text-white transition-colors duration-300 peer-checked:border-tcb13-water peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb13-water"><span class="absolute -left-1/4 bottom-0 h-[130%] w-[150%] translate-y-[105%] rounded-[42%_46%_0_0/14px] bg-tcb13-water transition-transform duration-500 ease-[cubic-bezier(.5,.1,.3,1)] group-hover:translate-y-[78%] group-has-checked:translate-y-0 group-has-checked:animate-tcb13-wave motion-reduce:animate-none motion-reduce:transition-none"></span><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="relative z-10 size-[15px] opacity-0 transition-opacity delay-180 duration-250 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span><span><span class="block text-[15px] font-medium">Morning workout</span><span class="block text-[13px] text-tcb13-mut">30 minutes</span></span></label>
<label class="group flex min-h-15 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="relative grid size-7 flex-none place-items-center overflow-hidden rounded-lg border-2 border-tcb13-box bg-white text-white transition-colors duration-300 peer-checked:border-tcb13-water peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb13-water"><span class="absolute -left-1/4 bottom-0 h-[130%] w-[150%] translate-y-[105%] rounded-[42%_46%_0_0/14px] bg-tcb13-water transition-transform duration-500 ease-[cubic-bezier(.5,.1,.3,1)] group-hover:translate-y-[78%] group-has-checked:translate-y-0 group-has-checked:animate-tcb13-wave motion-reduce:animate-none motion-reduce:transition-none"></span><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" class="relative z-10 size-[15px] opacity-0 transition-opacity delay-180 duration-250 group-has-checked:opacity-100"><path d="M20 6 9 17l-5-5"/></svg></span><span><span class="block text-[15px] font-medium">Read 20 pages</span><span class="block text-[13px] text-tcb13-mut">Before bed</span></span></label>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tcb13-bg: #eef4f8;
--color-tcb13-bg: oklch(0.96 0.008 235);
--color-tcb13-ink: #2c3a44;
--color-tcb13-ink: oklch(0.33 0.025 240);
--color-tcb13-mut: #566873;
--color-tcb13-mut: oklch(0.49 0.025 235);
--color-tcb13-line: #dce6ee;
--color-tcb13-line: oklch(0.92 0.012 240);
--color-tcb13-box: #8ea6b6;
--color-tcb13-box: oklch(0.7 0.035 235);
--color-tcb13-water: #2b86c4;
--color-tcb13-water: oklch(0.58 0.13 240);
--font-tcb13-sans: 'Outfit', system-ui, sans-serif;
--animate-tcb13-wave: tcb13-wave 3s linear infinite;
@keyframes tcb13-wave {
0%,
100% {
border-radius: 42% 46% 0 0 / 14px;
}
50% {
border-radius: 46% 40% 0 0 / 12px;
}
}
}
/* 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-13 {
width: 100%;
min-height: 100svh;
}
```How this works
A blob wider than its box. The liquid is 150% wide and 130% tall with asymmetric elliptical top corners; overflow-hidden on the box crops it to a wavy waterline.
State order. Hover (translate-y-[78%]) and checked (translate-y-0) both set translate; Tailwind orders group-has-checked: after group-hover:, so checked wins.
Slosh. The keyframes animate border-radius only — a cheap paint on a 28px element.
Make it yours
- Colour:
--color-tcb13-water. - Faster fill:
duration-300. - Disable slosh: remove
group-has-checked:animate-tcb13-wave. - Progress bar: reuse the liquid on a wide track with
translate-yset from a style variable.
Gotchas — read before shipping
- Border-radius animation repaints; don't use it on hundreds of rows.
- The tick needs
relative z-10to sit above the water. - Reduced motion stops the slosh and the rise but keeps the filled state.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
Elliptical border-radius and keyframes are universal.