29 Tailwind CSS Checkboxes
10 / 29

All 29 in 29 Tailwind CSS Checkboxes

  1. 01Tailwind CSS Toggle Switch — iOS-Style SaaS Settings
  2. 02Tailwind Filter Chip Checkbox — Style Checkbox as Button
  3. 03Tailwind Pricing Plan Card Select — Checkbox-Style Selectable Cards
  4. 04Pure Tailwind CSS Accordion with Checkbox — No JavaScript
  5. 05Tailwind Indeterminate Checkbox — Select All with Tri-State
  6. 06Accessible Custom Checkbox in Tailwind CSS — WCAG Focus Ring
  7. 07Tailwind Slide Toggle with ON/OFF Labels — GPU translate3d
  8. 08Neon Glow Checkbox in Tailwind CSS — Dark Mode Gaming UI
  9. 09Animated SVG Checkmark in Tailwind CSS — stroke-dashoffset Draw
  10. 10Bouncy Checkbox Animation in Tailwind CSS — Spring cubic-bezier
  11. 11Glassmorphism Checkbox in Tailwind CSS — backdrop-blur Frosted Glass
  12. 12Neumorphism Checkbox in Tailwind CSS — Soft UI
  13. 13Liquid Fill Checkbox Animation in Tailwind CSS — Water Wave
  14. 14Rotating Ring Checkbox in Tailwind CSS — Spin-to-Check
  15. 15Brutalist Checkbox in Tailwind CSS — Neo-Brutalism Hard Shadow
  16. 16Animated Gradient Checkbox in Tailwind CSS — Rainbow Sweep
  17. 173D Flip Checkbox in Tailwind CSS — perspective & backface-hidden
  18. 18Material Ripple Checkbox in Tailwind CSS — State Layer & Wave
  19. 19Retro Pixel Art Checkbox in Tailwind CSS — 8-Bit Arcade Menu
  20. 20Tailwind CSS To-Do List Checkbox with Animated Strikethrough
  21. 21Gooey Blob Checkbox in Tailwind CSS — blur + contrast Filter
  22. 22Tailwind Dark Mode Toggle Switch — Sun & Moon, No JavaScript
  23. 23Pulse Ring Checkbox in Tailwind CSS — Live Status Indicator
  24. 24Tailwind CSS Dash-to-Check SVG Morph Checkbox
  25. 25Tri-State Checkbox in Tailwind CSS + JavaScript — Done / N/A / Unset
  26. 26Magnetic Hover Checkbox in Tailwind CSS + JavaScript
  27. 27Confetti Checkbox Animation in Tailwind CSS — Pure CSS Particle Burst
  28. 28Slide-In Label Checkbox in Tailwind CSS — Saved Tag Reveal
  29. 29Aurora Gradient Toggle Switch in Tailwind CSS — Premium Dark UI
Pure TailwindMIT licensed

Bouncy Checkbox Animation in Tailwind CSS — Spring cubic-bezier

A squash-and-stretch pop on check: peer-checked:animate-tcb10-pop squeezes the box to 82% then overshoots to 112%, while the tick springs in on an ease-[cubic-bezier(.34,1.7,.5,1)] overshoot curve. Pressing now squashes the box before release.

Live Demo
Plain CSSTailwind v4
Try it

Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time

Untitled UI React · Affiliate link

Get Untitled UI Pro

The code

<section class="tcb-10 w-full min-h-svh grid place-items-center bg-tcb10-bg px-5 py-14 font-tcb10-sans text-tcb10-ink selection:bg-tcb10-acc selection:text-white" aria-label="Bouncy pop checkboxes">
  <div class="w-full max-w-[25rem] rounded-2xl border border-tcb10-line bg-white px-4 py-2.5">
    <label class="group flex min-h-13 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="grid size-[26px] flex-none place-items-center rounded-lg border-2 border-tcb10-box bg-white text-white transition-[background-color,border-color,scale] duration-200 group-active:scale-90 peer-checked:animate-tcb10-pop peer-checked:border-tcb10-acc peer-checked:bg-tcb10-acc peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb10-acc motion-reduce:animate-none motion-reduce:transition-none"><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-[15px] scale-0 opacity-0 transition-[opacity,scale] duration-300 ease-[cubic-bezier(.34,1.7,.5,1)] group-has-checked:scale-100 group-has-checked:opacity-100 motion-reduce:scale-100 motion-reduce:transition-opacity"><path d="M20 6 9 17l-5-5"/></svg></span><span class="text-[15px]">Add to favourites</span></label>
    <label class="group flex min-h-13 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-[26px] flex-none place-items-center rounded-lg border-2 border-tcb10-box bg-white text-white transition-[background-color,border-color,scale] duration-200 group-active:scale-90 peer-checked:animate-tcb10-pop peer-checked:border-tcb10-acc peer-checked:bg-tcb10-acc peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb10-acc motion-reduce:animate-none motion-reduce:transition-none"><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-[15px] scale-0 opacity-0 transition-[opacity,scale] duration-300 ease-[cubic-bezier(.34,1.7,.5,1)] group-has-checked:scale-100 group-has-checked:opacity-100 motion-reduce:scale-100 motion-reduce:transition-opacity"><path d="M20 6 9 17l-5-5"/></svg></span><span class="text-[15px]">Remind me later</span></label>
    <label class="group flex min-h-13 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-[26px] flex-none place-items-center rounded-lg border-2 border-tcb10-box bg-white text-white transition-[background-color,border-color,scale] duration-200 group-active:scale-90 peer-checked:animate-tcb10-pop peer-checked:border-tcb10-acc peer-checked:bg-tcb10-acc peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb10-acc motion-reduce:animate-none motion-reduce:transition-none"><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-[15px] scale-0 opacity-0 transition-[opacity,scale] duration-300 ease-[cubic-bezier(.34,1.7,.5,1)] group-has-checked:scale-100 group-has-checked:opacity-100 motion-reduce:scale-100 motion-reduce:transition-opacity"><path d="M20 6 9 17l-5-5"/></svg></span><span class="text-[15px]">Follow this thread</span></label>
  </div>
</section>
@import "tailwindcss";

@theme {
  --color-tcb10-bg: #fbf4f2;
  --color-tcb10-bg: oklch(0.97 0.01 35);
  --color-tcb10-ink: #3a2a27;
  --color-tcb10-ink: oklch(0.3 0.025 35);
  --color-tcb10-line: #f0dfda;
  --color-tcb10-line: oklch(0.92 0.02 35);
  --color-tcb10-box: #d49f93;
  --color-tcb10-box: oklch(0.74 0.07 35);
  --color-tcb10-acc: #df3d3d;
  --color-tcb10-acc: oklch(0.6 0.2 25);
  --font-tcb10-sans: 'Sora', system-ui, sans-serif;
  --animate-tcb10-pop: tcb10-pop 0.32s ease;

  @keyframes tcb10-pop {
    0% {
      scale: 1;
    }

    35% {
      scale: 0.82;
    }

    70% {
      scale: 1.12;
    }

    100% {
      scale: 1;
    }
  }
}
/* 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-10 {
  width: 100%;
  min-height: 100svh;
}

Setup — do this once per project

Skip this if your project already runs Tailwind v4.

1Load Tailwind
<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.

2Add the stylesheetRequiredthe @theme block is what makes the custom utilities exist
@import "tailwindcss";

@theme {
  --color-tcb10-bg: #fbf4f2;
  --color-tcb10-bg: oklch(0.97 0.01 35);
  --color-tcb10-ink: #3a2a27;
  --color-tcb10-ink: oklch(0.3 0.025 35);
  --color-tcb10-line: #f0dfda;
  --color-tcb10-line: oklch(0.92 0.02 35);
  --color-tcb10-box: #d49f93;
  --color-tcb10-box: oklch(0.74 0.07 35);
  --color-tcb10-acc: #df3d3d;
  --color-tcb10-acc: oklch(0.6 0.2 25);
  --font-tcb10-sans: 'Sora', system-ui, sans-serif;
  --animate-tcb10-pop: tcb10-pop 0.32s ease;

  @keyframes tcb10-pop {
    0% {
      scale: 1;
    }

    35% {
      scale: 0.82;
    }

    70% {
      scale: 1.12;
    }

    100% {
      scale: 1;
    }
  }
}
/* 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-10 {
  width: 100%;
  min-height: 100svh;
}
3Fonts used by this demooptional — skip if you have your own type stack
<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=Sora:wght@400;500;600;700&display=swap">

What changed in the port

Which parts became utilities, which stayed CSS, and why.

  • @keyframes cb-10-pop{transform:scale(…)} became a token animation over the standalone scale property — v4's native transform model.
  • The tick's ::after mask became an inline SVG with scale-0 → group-has-checked:scale-100.
  • UI upgrade from the CSS original: press anticipation (group-active:scale-90) so the bounce reads as a release, and rows are 52px tall.
  • UI upgrade: the empty-box border rose from #e3b7ad (1.8:1) to 3:1 on white.
Paste this into ChatGPT, Claude, Cursor, or any coding assistant. The block below is pre-framed with everything the AI needs to integrate this demo into your project — markup, styles, scoping notes, and the source URL. Hit Copy and paste straight into your chat.
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: Bouncy Checkbox Animation in Tailwind CSS — Spring cubic-bezier
Source: https://codefronts.com/components/tailwind-css-checkboxes/bouncy-checkbox-animation-tailwind/

A squash-and-stretch pop on check: peer-checked:animate-tcb10-pop squeezes the box to 82% then overshoots to 112%, while the tick springs in on an ease-[cubic-bezier(.34,1.7,.5,1)] overshoot curve. Pressing now squashes the box before release.
## HTML
```html
<section class="tcb-10 w-full min-h-svh grid place-items-center bg-tcb10-bg px-5 py-14 font-tcb10-sans text-tcb10-ink selection:bg-tcb10-acc selection:text-white" aria-label="Bouncy pop checkboxes">
  <div class="w-full max-w-[25rem] rounded-2xl border border-tcb10-line bg-white px-4 py-2.5">
    <label class="group flex min-h-13 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="grid size-[26px] flex-none place-items-center rounded-lg border-2 border-tcb10-box bg-white text-white transition-[background-color,border-color,scale] duration-200 group-active:scale-90 peer-checked:animate-tcb10-pop peer-checked:border-tcb10-acc peer-checked:bg-tcb10-acc peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb10-acc motion-reduce:animate-none motion-reduce:transition-none"><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-[15px] scale-0 opacity-0 transition-[opacity,scale] duration-300 ease-[cubic-bezier(.34,1.7,.5,1)] group-has-checked:scale-100 group-has-checked:opacity-100 motion-reduce:scale-100 motion-reduce:transition-opacity"><path d="M20 6 9 17l-5-5"/></svg></span><span class="text-[15px]">Add to favourites</span></label>
    <label class="group flex min-h-13 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-[26px] flex-none place-items-center rounded-lg border-2 border-tcb10-box bg-white text-white transition-[background-color,border-color,scale] duration-200 group-active:scale-90 peer-checked:animate-tcb10-pop peer-checked:border-tcb10-acc peer-checked:bg-tcb10-acc peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb10-acc motion-reduce:animate-none motion-reduce:transition-none"><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-[15px] scale-0 opacity-0 transition-[opacity,scale] duration-300 ease-[cubic-bezier(.34,1.7,.5,1)] group-has-checked:scale-100 group-has-checked:opacity-100 motion-reduce:scale-100 motion-reduce:transition-opacity"><path d="M20 6 9 17l-5-5"/></svg></span><span class="text-[15px]">Remind me later</span></label>
    <label class="group flex min-h-13 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-[26px] flex-none place-items-center rounded-lg border-2 border-tcb10-box bg-white text-white transition-[background-color,border-color,scale] duration-200 group-active:scale-90 peer-checked:animate-tcb10-pop peer-checked:border-tcb10-acc peer-checked:bg-tcb10-acc peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb10-acc motion-reduce:animate-none motion-reduce:transition-none"><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-[15px] scale-0 opacity-0 transition-[opacity,scale] duration-300 ease-[cubic-bezier(.34,1.7,.5,1)] group-has-checked:scale-100 group-has-checked:opacity-100 motion-reduce:scale-100 motion-reduce:transition-opacity"><path d="M20 6 9 17l-5-5"/></svg></span><span class="text-[15px]">Follow this thread</span></label>
  </div>
</section>
```
## CSS
```css
@import "tailwindcss";

@theme {
  --color-tcb10-bg: #fbf4f2;
  --color-tcb10-bg: oklch(0.97 0.01 35);
  --color-tcb10-ink: #3a2a27;
  --color-tcb10-ink: oklch(0.3 0.025 35);
  --color-tcb10-line: #f0dfda;
  --color-tcb10-line: oklch(0.92 0.02 35);
  --color-tcb10-box: #d49f93;
  --color-tcb10-box: oklch(0.74 0.07 35);
  --color-tcb10-acc: #df3d3d;
  --color-tcb10-acc: oklch(0.6 0.2 25);
  --font-tcb10-sans: 'Sora', system-ui, sans-serif;
  --animate-tcb10-pop: tcb10-pop 0.32s ease;

  @keyframes tcb10-pop {
    0% {
      scale: 1;
    }

    35% {
      scale: 0.82;
    }

    70% {
      scale: 1.12;
    }

    100% {
      scale: 1;
    }
  }
}
/* 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-10 {
  width: 100%;
  min-height: 100svh;
}
```

How this works

Keyframes vs. transition. The box uses a keyframe (it must dip and overshoot); the tick uses a transition with an overshooting bezier (one move, springy landing).

v4 scale is its own property. Tailwind v4 compiles scale-* to the standalone scale property, so the keyframes animate scale directly and never fight translate utilities.

Anticipation. group-active:scale-90 squashes while the pointer is down, so the pop reads as a release.

Make it yours

  • Heavier bounce: raise the bezier's second value to 2.
  • Heart variant: swap the tick path for a heart and --color-tcb10-acc for pink.
  • Only on check: the pop runs on :checked; add an animate-tcb10-pop to the unchecked state for a double-bounce.
  • Duration: edit the --animate-tcb10-pop token.

Gotchas — read before shipping

  • An animation runs when its rule starts matching — initially-checked boxes pop on page load.
  • Cubic-bezier y-values above 1 overshoot; x-values must stay within 0–1.
  • Keep the pop ≤350ms: longer bounces make repeated toggling feel sluggish.

Browser support

ChromeSafariFirefoxEdge
111+16.4+128+111+

The individual scale property needs Chrome 104 / Safari 14.1 / Firefox 72.

Techniques used in this demo

Plain CSSno Tailwind surface

Search CodeFronts

Loading…