29 Tailwind CSS Checkboxes
09 / 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

Animated SVG Checkmark in Tailwind CSS — stroke-dashoffset Draw

The checkmark draws itself: an inline SVG path starts fully dashed-out with [stroke-dashoffset:24] and animates to group-has-checked:[stroke-dashoffset:0]. Rows become a pipeline with a connecting rail and step captions.

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-09 w-full min-h-svh grid place-items-center bg-tcb09-bg px-5 py-14 font-tcb09-sans text-tcb09-ink selection:bg-tcb09-acc selection:text-white" aria-label="Draw-stroke checkmark checkboxes">
  <div class="w-full max-w-[25rem] rounded-2xl border border-tcb09-line bg-white px-4 py-3">
    <label class="group relative flex min-h-16 cursor-pointer items-center gap-3.5 px-2 before:absolute before:left-[21px] before:top-[calc(50%+17px)] before:h-[calc(100%-34px)] before:w-0.5 before:rounded-full before:bg-tcb09-line before:content-['']"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="grid size-[26px] flex-none place-items-center rounded-[7px] border-2 border-tcb09-box bg-white text-white transition-colors duration-250 peer-checked:border-tcb09-acc peer-checked:bg-tcb09-acc peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb09-acc motion-reduce:transition-none"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="size-[18px]"><path d="M4.5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] duration-450 ease-[cubic-bezier(.6,.1,.3,1)] [stroke-dasharray:24] [stroke-dashoffset:24] group-has-checked:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></span><span><span class="block text-[15px] font-medium">Contract signed</span><span class="block text-[13px] text-tcb09-mut">Legal · step 1</span></span></label>
    <label class="group relative flex min-h-16 cursor-pointer items-center gap-3.5 px-2 before:absolute before:left-[21px] before:top-[calc(50%+17px)] before:h-[calc(100%-34px)] before:w-0.5 before:rounded-full before:bg-tcb09-line before:content-['']"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-[26px] flex-none place-items-center rounded-[7px] border-2 border-tcb09-box bg-white text-white transition-colors duration-250 peer-checked:border-tcb09-acc peer-checked:bg-tcb09-acc peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb09-acc motion-reduce:transition-none"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="size-[18px]"><path d="M4.5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] duration-450 ease-[cubic-bezier(.6,.1,.3,1)] [stroke-dasharray:24] [stroke-dashoffset:24] group-has-checked:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></span><span><span class="block text-[15px] font-medium">Payment received</span><span class="block text-[13px] text-tcb09-mut">Finance · step 2</span></span></label>
    <label class="group relative flex min-h-16 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-[7px] border-2 border-tcb09-box bg-white text-white transition-colors duration-250 peer-checked:border-tcb09-acc peer-checked:bg-tcb09-acc peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb09-acc motion-reduce:transition-none"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="size-[18px]"><path d="M4.5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] duration-450 ease-[cubic-bezier(.6,.1,.3,1)] [stroke-dasharray:24] [stroke-dashoffset:24] group-has-checked:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></span><span><span class="block text-[15px] font-medium">Shipment dispatched</span><span class="block text-[13px] text-tcb09-mut">Ops · step 3</span></span></label>
  </div>
</section>
@import "tailwindcss";

@theme {
  --color-tcb09-bg: #f3f6f4;
  --color-tcb09-bg: oklch(0.97 0.005 155);
  --color-tcb09-ink: #2c352f;
  --color-tcb09-ink: oklch(0.31 0.015 155);
  --color-tcb09-mut: #5b675f;
  --color-tcb09-mut: oklch(0.49 0.015 155);
  --color-tcb09-line: #e2e8e4;
  --color-tcb09-line: oklch(0.92 0.008 155);
  --color-tcb09-box: #9aa89f;
  --color-tcb09-box: oklch(0.7 0.018 155);
  --color-tcb09-acc: #1f8a4c;
  --color-tcb09-acc: oklch(0.55 0.14 152);
  --font-tcb09-sans: 'Outfit', 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-09 {
  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-tcb09-bg: #f3f6f4;
  --color-tcb09-bg: oklch(0.97 0.005 155);
  --color-tcb09-ink: #2c352f;
  --color-tcb09-ink: oklch(0.31 0.015 155);
  --color-tcb09-mut: #5b675f;
  --color-tcb09-mut: oklch(0.49 0.015 155);
  --color-tcb09-line: #e2e8e4;
  --color-tcb09-line: oklch(0.92 0.008 155);
  --color-tcb09-box: #9aa89f;
  --color-tcb09-box: oklch(0.7 0.018 155);
  --color-tcb09-acc: #1f8a4c;
  --color-tcb09-acc: oklch(0.55 0.14 152);
  --font-tcb09-sans: 'Outfit', 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-09 {
  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=Outfit:wght@400;500;600;700&display=swap">

What changed in the port

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

  • .box svg path{stroke-dasharray:24;stroke-dashoffset:24} became arbitrary properties on the path; the :checked descendant rule became group-has-checked:[stroke-dashoffset:0].
  • .box svg{stroke:#fff} became stroke="currentColor" + text-white on the box.
  • UI upgrade from the CSS original: the list reads as a pipeline — a connecting rail links the step boxes and each row has a step caption.
  • UI upgrade: the empty-box border rose from #c2ccc6 (1.6:1) to 3:1 so unchecked boxes are visible (WCAG 1.4.11).
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: Animated SVG Checkmark in Tailwind CSS — stroke-dashoffset Draw
Source: https://codefronts.com/components/tailwind-css-checkboxes/animated-svg-checkmark-tailwind-stroke-draw/

The checkmark draws itself: an inline SVG path starts fully dashed-out with [stroke-dashoffset:24] and animates to group-has-checked:[stroke-dashoffset:0]. Rows become a pipeline with a connecting rail and step captions.
## HTML
```html
<section class="tcb-09 w-full min-h-svh grid place-items-center bg-tcb09-bg px-5 py-14 font-tcb09-sans text-tcb09-ink selection:bg-tcb09-acc selection:text-white" aria-label="Draw-stroke checkmark checkboxes">
  <div class="w-full max-w-[25rem] rounded-2xl border border-tcb09-line bg-white px-4 py-3">
    <label class="group relative flex min-h-16 cursor-pointer items-center gap-3.5 px-2 before:absolute before:left-[21px] before:top-[calc(50%+17px)] before:h-[calc(100%-34px)] before:w-0.5 before:rounded-full before:bg-tcb09-line before:content-['']"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="grid size-[26px] flex-none place-items-center rounded-[7px] border-2 border-tcb09-box bg-white text-white transition-colors duration-250 peer-checked:border-tcb09-acc peer-checked:bg-tcb09-acc peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb09-acc motion-reduce:transition-none"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="size-[18px]"><path d="M4.5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] duration-450 ease-[cubic-bezier(.6,.1,.3,1)] [stroke-dasharray:24] [stroke-dashoffset:24] group-has-checked:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></span><span><span class="block text-[15px] font-medium">Contract signed</span><span class="block text-[13px] text-tcb09-mut">Legal · step 1</span></span></label>
    <label class="group relative flex min-h-16 cursor-pointer items-center gap-3.5 px-2 before:absolute before:left-[21px] before:top-[calc(50%+17px)] before:h-[calc(100%-34px)] before:w-0.5 before:rounded-full before:bg-tcb09-line before:content-['']"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-[26px] flex-none place-items-center rounded-[7px] border-2 border-tcb09-box bg-white text-white transition-colors duration-250 peer-checked:border-tcb09-acc peer-checked:bg-tcb09-acc peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb09-acc motion-reduce:transition-none"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="size-[18px]"><path d="M4.5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] duration-450 ease-[cubic-bezier(.6,.1,.3,1)] [stroke-dasharray:24] [stroke-dashoffset:24] group-has-checked:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></span><span><span class="block text-[15px] font-medium">Payment received</span><span class="block text-[13px] text-tcb09-mut">Finance · step 2</span></span></label>
    <label class="group relative flex min-h-16 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-[7px] border-2 border-tcb09-box bg-white text-white transition-colors duration-250 peer-checked:border-tcb09-acc peer-checked:bg-tcb09-acc peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb09-acc motion-reduce:transition-none"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="size-[18px]"><path d="M4.5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] duration-450 ease-[cubic-bezier(.6,.1,.3,1)] [stroke-dasharray:24] [stroke-dashoffset:24] group-has-checked:[stroke-dashoffset:0] motion-reduce:transition-none"/></svg></span><span><span class="block text-[15px] font-medium">Shipment dispatched</span><span class="block text-[13px] text-tcb09-mut">Ops · step 3</span></span></label>
  </div>
</section>
```
## CSS
```css
@import "tailwindcss";

@theme {
  --color-tcb09-bg: #f3f6f4;
  --color-tcb09-bg: oklch(0.97 0.005 155);
  --color-tcb09-ink: #2c352f;
  --color-tcb09-ink: oklch(0.31 0.015 155);
  --color-tcb09-mut: #5b675f;
  --color-tcb09-mut: oklch(0.49 0.015 155);
  --color-tcb09-line: #e2e8e4;
  --color-tcb09-line: oklch(0.92 0.008 155);
  --color-tcb09-box: #9aa89f;
  --color-tcb09-box: oklch(0.7 0.018 155);
  --color-tcb09-acc: #1f8a4c;
  --color-tcb09-acc: oklch(0.55 0.14 152);
  --font-tcb09-sans: 'Outfit', 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-09 {
  width: 100%;
  min-height: 100svh;
}
```

How this works

Dash trick. A dash as long as the path (24 units), offset by its own length, hides the stroke; transitioning the offset to 0 draws it from start to end.

Arbitrary properties. Tailwind has no stroke-dashoffset utility, so the square-bracket property syntax writes raw declarations that still take variants: group-has-checked:[stroke-dashoffset:0].

Reduced motion removes the transition but keeps the drawn end state.

Make it yours

  • Slower draw: duration-700.
  • Longer paths: measure with path.getTotalLength() and set both dash values to it.
  • Round box: rounded-full on the box.
  • Remove the rail for a flat checklist.

Gotchas — read before shipping

  • Underscores → spaces: complex stroke-dasharray patterns need [stroke-dasharray:4_2].
  • Set pathLength="1" on the path if you'd rather use unitless 1 → 0 offsets.
  • SVG must be aria-hidden; the checkbox carries the state.

Browser support

ChromeSafariFirefoxEdge
111+16.4+128+111+

Transitioning stroke-dashoffset works in every modern engine.

Techniques used in this demo

Search CodeFronts

Loading…