24 / 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
Tailwind CSS Dash-to-Check SVG Morph Checkbox
A pending dash retracts as a checkmark draws in — two SVG paths trading stroke-dashoffset with a 120ms stagger, while the whole glyph tilts -rotate-8. New: a status label on the right swaps Pending → Approved, so the row states its meaning in words.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<section class="tcb-24 w-full min-h-svh grid place-items-center bg-tcb24-bg px-5 py-14 font-tcb24-sans text-tcb24-ink selection:bg-tcb24-acc selection:text-white" aria-label="Dash to check morph checkboxes">
<div class="w-full max-w-[26rem] rounded-2xl border border-tcb24-line bg-white px-4 py-2.5">
<label class="group flex min-h-14 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="grid size-7 flex-none place-items-center rounded-lg border-2 border-tcb24-box bg-white text-tcb24-dash transition-colors duration-300 peer-checked:border-tcb24-acc peer-checked:bg-tcb24-acc peer-checked:text-white peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb24-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-5 transition-[rotate] duration-400 group-has-checked:-rotate-8"><path d="M6 12H18" class="transition-[stroke-dashoffset] duration-300 [stroke-dasharray:12] [stroke-dashoffset:0] group-has-checked:[stroke-dashoffset:12] motion-reduce:transition-none"/><path d="M5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] delay-120 duration-400 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 class="flex-1 text-[15px]">Review approved</span><span aria-hidden="true" class="font-tcb24-mono text-[11px] font-semibold uppercase tracking-[0.08em] text-tcb24-mut after:content-['Pending'] group-has-checked:text-tcb24-acc group-has-checked:after:content-['Approved']"></span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-7 flex-none place-items-center rounded-lg border-2 border-tcb24-box bg-white text-tcb24-dash transition-colors duration-300 peer-checked:border-tcb24-acc peer-checked:bg-tcb24-acc peer-checked:text-white peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb24-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-5 transition-[rotate] duration-400 group-has-checked:-rotate-8"><path d="M6 12H18" class="transition-[stroke-dashoffset] duration-300 [stroke-dasharray:12] [stroke-dashoffset:0] group-has-checked:[stroke-dashoffset:12] motion-reduce:transition-none"/><path d="M5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] delay-120 duration-400 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 class="flex-1 text-[15px]">Awaiting sign-off</span><span aria-hidden="true" class="font-tcb24-mono text-[11px] font-semibold uppercase tracking-[0.08em] text-tcb24-mut after:content-['Pending'] group-has-checked:text-tcb24-acc group-has-checked:after:content-['Approved']"></span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-7 flex-none place-items-center rounded-lg border-2 border-tcb24-box bg-white text-tcb24-dash transition-colors duration-300 peer-checked:border-tcb24-acc peer-checked:bg-tcb24-acc peer-checked:text-white peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb24-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-5 transition-[rotate] duration-400 group-has-checked:-rotate-8"><path d="M6 12H18" class="transition-[stroke-dashoffset] duration-300 [stroke-dasharray:12] [stroke-dashoffset:0] group-has-checked:[stroke-dashoffset:12] motion-reduce:transition-none"/><path d="M5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] delay-120 duration-400 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 class="flex-1 text-[15px]">Pending checks</span><span aria-hidden="true" class="font-tcb24-mono text-[11px] font-semibold uppercase tracking-[0.08em] text-tcb24-mut after:content-['Pending'] group-has-checked:text-tcb24-acc group-has-checked:after:content-['Approved']"></span></label>
</div>
</section><section class="tcb-24 w-full min-h-svh grid place-items-center bg-tcb24-bg px-5 py-14 font-tcb24-sans text-tcb24-ink selection:bg-tcb24-acc selection:text-white" aria-label="Dash to check morph checkboxes">
<div class="w-full max-w-[26rem] rounded-2xl border border-tcb24-line bg-white px-4 py-2.5">
<label class="group flex min-h-14 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="grid size-7 flex-none place-items-center rounded-lg border-2 border-tcb24-box bg-white text-tcb24-dash transition-colors duration-300 peer-checked:border-tcb24-acc peer-checked:bg-tcb24-acc peer-checked:text-white peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb24-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-5 transition-[rotate] duration-400 group-has-checked:-rotate-8"><path d="M6 12H18" class="transition-[stroke-dashoffset] duration-300 [stroke-dasharray:12] [stroke-dashoffset:0] group-has-checked:[stroke-dashoffset:12] motion-reduce:transition-none"/><path d="M5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] delay-120 duration-400 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 class="flex-1 text-[15px]">Review approved</span><span aria-hidden="true" class="font-tcb24-mono text-[11px] font-semibold uppercase tracking-[0.08em] text-tcb24-mut after:content-['Pending'] group-has-checked:text-tcb24-acc group-has-checked:after:content-['Approved']"></span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-7 flex-none place-items-center rounded-lg border-2 border-tcb24-box bg-white text-tcb24-dash transition-colors duration-300 peer-checked:border-tcb24-acc peer-checked:bg-tcb24-acc peer-checked:text-white peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb24-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-5 transition-[rotate] duration-400 group-has-checked:-rotate-8"><path d="M6 12H18" class="transition-[stroke-dashoffset] duration-300 [stroke-dasharray:12] [stroke-dashoffset:0] group-has-checked:[stroke-dashoffset:12] motion-reduce:transition-none"/><path d="M5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] delay-120 duration-400 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 class="flex-1 text-[15px]">Awaiting sign-off</span><span aria-hidden="true" class="font-tcb24-mono text-[11px] font-semibold uppercase tracking-[0.08em] text-tcb24-mut after:content-['Pending'] group-has-checked:text-tcb24-acc group-has-checked:after:content-['Approved']"></span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-7 flex-none place-items-center rounded-lg border-2 border-tcb24-box bg-white text-tcb24-dash transition-colors duration-300 peer-checked:border-tcb24-acc peer-checked:bg-tcb24-acc peer-checked:text-white peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb24-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-5 transition-[rotate] duration-400 group-has-checked:-rotate-8"><path d="M6 12H18" class="transition-[stroke-dashoffset] duration-300 [stroke-dasharray:12] [stroke-dashoffset:0] group-has-checked:[stroke-dashoffset:12] motion-reduce:transition-none"/><path d="M5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] delay-120 duration-400 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 class="flex-1 text-[15px]">Pending checks</span><span aria-hidden="true" class="font-tcb24-mono text-[11px] font-semibold uppercase tracking-[0.08em] text-tcb24-mut after:content-['Pending'] group-has-checked:text-tcb24-acc group-has-checked:after:content-['Approved']"></span></label>
</div>
</section>@import "tailwindcss";
@theme {
--color-tcb24-bg: #eef2f8;
--color-tcb24-bg: oklch(0.96 0.01 255);
--color-tcb24-ink: #2c3540;
--color-tcb24-ink: oklch(0.32 0.02 250);
--color-tcb24-mut: #5e6a7c;
--color-tcb24-mut: oklch(0.5 0.03 255);
--color-tcb24-line: #dde5f0;
--color-tcb24-line: oklch(0.92 0.013 255);
--color-tcb24-box: #8e9db4;
--color-tcb24-box: oklch(0.7 0.035 255);
--color-tcb24-dash: #6b7890;
--color-tcb24-dash: oklch(0.57 0.035 255);
--color-tcb24-acc: #1f6fc0;
--color-tcb24-acc: oklch(0.53 0.15 250);
--font-tcb24-sans: 'Instrument Sans', system-ui, sans-serif;
--font-tcb24-mono: 'JetBrains Mono', ui-monospace, monospace;
}
/* 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-24 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-tcb24-bg: #eef2f8;
--color-tcb24-bg: oklch(0.96 0.01 255);
--color-tcb24-ink: #2c3540;
--color-tcb24-ink: oklch(0.32 0.02 250);
--color-tcb24-mut: #5e6a7c;
--color-tcb24-mut: oklch(0.5 0.03 255);
--color-tcb24-line: #dde5f0;
--color-tcb24-line: oklch(0.92 0.013 255);
--color-tcb24-box: #8e9db4;
--color-tcb24-box: oklch(0.7 0.035 255);
--color-tcb24-dash: #6b7890;
--color-tcb24-dash: oklch(0.57 0.035 255);
--color-tcb24-acc: #1f6fc0;
--color-tcb24-acc: oklch(0.53 0.15 250);
--font-tcb24-sans: 'Instrument Sans', system-ui, sans-serif;
--font-tcb24-mono: 'JetBrains Mono', ui-monospace, monospace;
}
/* 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-24 {
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-tcb24-bg: #eef2f8;
--color-tcb24-bg: oklch(0.96 0.01 255);
--color-tcb24-ink: #2c3540;
--color-tcb24-ink: oklch(0.32 0.02 250);
--color-tcb24-mut: #5e6a7c;
--color-tcb24-mut: oklch(0.5 0.03 255);
--color-tcb24-line: #dde5f0;
--color-tcb24-line: oklch(0.92 0.013 255);
--color-tcb24-box: #8e9db4;
--color-tcb24-box: oklch(0.7 0.035 255);
--color-tcb24-dash: #6b7890;
--color-tcb24-dash: oklch(0.57 0.035 255);
--color-tcb24-acc: #1f6fc0;
--color-tcb24-acc: oklch(0.53 0.15 250);
--font-tcb24-sans: 'Instrument Sans', system-ui, sans-serif;
--font-tcb24-mono: 'JetBrains Mono', ui-monospace, monospace;
}
/* 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-24 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-tcb24-bg: #eef2f8;
--color-tcb24-bg: oklch(0.96 0.01 255);
--color-tcb24-ink: #2c3540;
--color-tcb24-ink: oklch(0.32 0.02 250);
--color-tcb24-mut: #5e6a7c;
--color-tcb24-mut: oklch(0.5 0.03 255);
--color-tcb24-line: #dde5f0;
--color-tcb24-line: oklch(0.92 0.013 255);
--color-tcb24-box: #8e9db4;
--color-tcb24-box: oklch(0.7 0.035 255);
--color-tcb24-dash: #6b7890;
--color-tcb24-dash: oklch(0.57 0.035 255);
--color-tcb24-acc: #1f6fc0;
--color-tcb24-acc: oklch(0.53 0.15 250);
--font-tcb24-sans: 'Instrument Sans', system-ui, sans-serif;
--font-tcb24-mono: 'JetBrains Mono', ui-monospace, monospace;
}
/* 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-24 {
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&family=JetBrains+Mono: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&family=JetBrains+Mono:wght@400;500;600;700&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
- The two path rules and their
:checkedcounterparts became arbitrary[stroke-dash*]properties withgroup-has-checked:. svg{stroke:#8b98ac}→stroke:#fffbecametext-tcb24-dash peer-checked:text-whiteviacurrentColor.- UI upgrade from the CSS original: a Pending / Approved status word on each row, so the state is legible in words, not just glyph shape.
- UI upgrade: the empty border rose from
#b7c4d8(1.7:1) to 3:1 and the dash from 2.9:1 to 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: Tailwind CSS Dash-to-Check SVG Morph Checkbox
Source: https://codefronts.com/components/tailwind-css-checkboxes/tailwind-dash-to-check-svg-morph-checkbox/
A pending dash retracts as a checkmark draws in — two SVG paths trading stroke-dashoffset with a 120ms stagger, while the whole glyph tilts -rotate-8. New: a status label on the right swaps Pending → Approved, so the row states its meaning in words.
## HTML
```html
<section class="tcb-24 w-full min-h-svh grid place-items-center bg-tcb24-bg px-5 py-14 font-tcb24-sans text-tcb24-ink selection:bg-tcb24-acc selection:text-white" aria-label="Dash to check morph checkboxes">
<div class="w-full max-w-[26rem] rounded-2xl border border-tcb24-line bg-white px-4 py-2.5">
<label class="group flex min-h-14 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="grid size-7 flex-none place-items-center rounded-lg border-2 border-tcb24-box bg-white text-tcb24-dash transition-colors duration-300 peer-checked:border-tcb24-acc peer-checked:bg-tcb24-acc peer-checked:text-white peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb24-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-5 transition-[rotate] duration-400 group-has-checked:-rotate-8"><path d="M6 12H18" class="transition-[stroke-dashoffset] duration-300 [stroke-dasharray:12] [stroke-dashoffset:0] group-has-checked:[stroke-dashoffset:12] motion-reduce:transition-none"/><path d="M5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] delay-120 duration-400 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 class="flex-1 text-[15px]">Review approved</span><span aria-hidden="true" class="font-tcb24-mono text-[11px] font-semibold uppercase tracking-[0.08em] text-tcb24-mut after:content-['Pending'] group-has-checked:text-tcb24-acc group-has-checked:after:content-['Approved']"></span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-7 flex-none place-items-center rounded-lg border-2 border-tcb24-box bg-white text-tcb24-dash transition-colors duration-300 peer-checked:border-tcb24-acc peer-checked:bg-tcb24-acc peer-checked:text-white peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb24-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-5 transition-[rotate] duration-400 group-has-checked:-rotate-8"><path d="M6 12H18" class="transition-[stroke-dashoffset] duration-300 [stroke-dasharray:12] [stroke-dashoffset:0] group-has-checked:[stroke-dashoffset:12] motion-reduce:transition-none"/><path d="M5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] delay-120 duration-400 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 class="flex-1 text-[15px]">Awaiting sign-off</span><span aria-hidden="true" class="font-tcb24-mono text-[11px] font-semibold uppercase tracking-[0.08em] text-tcb24-mut after:content-['Pending'] group-has-checked:text-tcb24-acc group-has-checked:after:content-['Approved']"></span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-7 flex-none place-items-center rounded-lg border-2 border-tcb24-box bg-white text-tcb24-dash transition-colors duration-300 peer-checked:border-tcb24-acc peer-checked:bg-tcb24-acc peer-checked:text-white peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb24-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-5 transition-[rotate] duration-400 group-has-checked:-rotate-8"><path d="M6 12H18" class="transition-[stroke-dashoffset] duration-300 [stroke-dasharray:12] [stroke-dashoffset:0] group-has-checked:[stroke-dashoffset:12] motion-reduce:transition-none"/><path d="M5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] delay-120 duration-400 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 class="flex-1 text-[15px]">Pending checks</span><span aria-hidden="true" class="font-tcb24-mono text-[11px] font-semibold uppercase tracking-[0.08em] text-tcb24-mut after:content-['Pending'] group-has-checked:text-tcb24-acc group-has-checked:after:content-['Approved']"></span></label>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tcb24-bg: #eef2f8;
--color-tcb24-bg: oklch(0.96 0.01 255);
--color-tcb24-ink: #2c3540;
--color-tcb24-ink: oklch(0.32 0.02 250);
--color-tcb24-mut: #5e6a7c;
--color-tcb24-mut: oklch(0.5 0.03 255);
--color-tcb24-line: #dde5f0;
--color-tcb24-line: oklch(0.92 0.013 255);
--color-tcb24-box: #8e9db4;
--color-tcb24-box: oklch(0.7 0.035 255);
--color-tcb24-dash: #6b7890;
--color-tcb24-dash: oklch(0.57 0.035 255);
--color-tcb24-acc: #1f6fc0;
--color-tcb24-acc: oklch(0.53 0.15 250);
--font-tcb24-sans: 'Instrument Sans', system-ui, sans-serif;
--font-tcb24-mono: 'JetBrains Mono', ui-monospace, monospace;
}
/* 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-24 {
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: Tailwind CSS Dash-to-Check SVG Morph Checkbox
Source: https://codefronts.com/components/tailwind-css-checkboxes/tailwind-dash-to-check-svg-morph-checkbox/
A pending dash retracts as a checkmark draws in — two SVG paths trading stroke-dashoffset with a 120ms stagger, while the whole glyph tilts -rotate-8. New: a status label on the right swaps Pending → Approved, so the row states its meaning in words.
## HTML
```html
<section class="tcb-24 w-full min-h-svh grid place-items-center bg-tcb24-bg px-5 py-14 font-tcb24-sans text-tcb24-ink selection:bg-tcb24-acc selection:text-white" aria-label="Dash to check morph checkboxes">
<div class="w-full max-w-[26rem] rounded-2xl border border-tcb24-line bg-white px-4 py-2.5">
<label class="group flex min-h-14 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only" checked><span aria-hidden="true" class="grid size-7 flex-none place-items-center rounded-lg border-2 border-tcb24-box bg-white text-tcb24-dash transition-colors duration-300 peer-checked:border-tcb24-acc peer-checked:bg-tcb24-acc peer-checked:text-white peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb24-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-5 transition-[rotate] duration-400 group-has-checked:-rotate-8"><path d="M6 12H18" class="transition-[stroke-dashoffset] duration-300 [stroke-dasharray:12] [stroke-dashoffset:0] group-has-checked:[stroke-dashoffset:12] motion-reduce:transition-none"/><path d="M5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] delay-120 duration-400 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 class="flex-1 text-[15px]">Review approved</span><span aria-hidden="true" class="font-tcb24-mono text-[11px] font-semibold uppercase tracking-[0.08em] text-tcb24-mut after:content-['Pending'] group-has-checked:text-tcb24-acc group-has-checked:after:content-['Approved']"></span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-7 flex-none place-items-center rounded-lg border-2 border-tcb24-box bg-white text-tcb24-dash transition-colors duration-300 peer-checked:border-tcb24-acc peer-checked:bg-tcb24-acc peer-checked:text-white peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb24-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-5 transition-[rotate] duration-400 group-has-checked:-rotate-8"><path d="M6 12H18" class="transition-[stroke-dashoffset] duration-300 [stroke-dasharray:12] [stroke-dashoffset:0] group-has-checked:[stroke-dashoffset:12] motion-reduce:transition-none"/><path d="M5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] delay-120 duration-400 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 class="flex-1 text-[15px]">Awaiting sign-off</span><span aria-hidden="true" class="font-tcb24-mono text-[11px] font-semibold uppercase tracking-[0.08em] text-tcb24-mut after:content-['Pending'] group-has-checked:text-tcb24-acc group-has-checked:after:content-['Approved']"></span></label>
<label class="group flex min-h-14 cursor-pointer items-center gap-3.5 px-2"><input type="checkbox" class="peer sr-only"><span aria-hidden="true" class="grid size-7 flex-none place-items-center rounded-lg border-2 border-tcb24-box bg-white text-tcb24-dash transition-colors duration-300 peer-checked:border-tcb24-acc peer-checked:bg-tcb24-acc peer-checked:text-white peer-focus-visible:outline-3 peer-focus-visible:outline-offset-3 peer-focus-visible:outline-tcb24-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-5 transition-[rotate] duration-400 group-has-checked:-rotate-8"><path d="M6 12H18" class="transition-[stroke-dashoffset] duration-300 [stroke-dasharray:12] [stroke-dashoffset:0] group-has-checked:[stroke-dashoffset:12] motion-reduce:transition-none"/><path d="M5 12.5 10 18 20 6" class="transition-[stroke-dashoffset] delay-120 duration-400 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 class="flex-1 text-[15px]">Pending checks</span><span aria-hidden="true" class="font-tcb24-mono text-[11px] font-semibold uppercase tracking-[0.08em] text-tcb24-mut after:content-['Pending'] group-has-checked:text-tcb24-acc group-has-checked:after:content-['Approved']"></span></label>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tcb24-bg: #eef2f8;
--color-tcb24-bg: oklch(0.96 0.01 255);
--color-tcb24-ink: #2c3540;
--color-tcb24-ink: oklch(0.32 0.02 250);
--color-tcb24-mut: #5e6a7c;
--color-tcb24-mut: oklch(0.5 0.03 255);
--color-tcb24-line: #dde5f0;
--color-tcb24-line: oklch(0.92 0.013 255);
--color-tcb24-box: #8e9db4;
--color-tcb24-box: oklch(0.7 0.035 255);
--color-tcb24-dash: #6b7890;
--color-tcb24-dash: oklch(0.57 0.035 255);
--color-tcb24-acc: #1f6fc0;
--color-tcb24-acc: oklch(0.53 0.15 250);
--font-tcb24-sans: 'Instrument Sans', system-ui, sans-serif;
--font-tcb24-mono: 'JetBrains Mono', ui-monospace, monospace;
}
/* 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-24 {
width: 100%;
min-height: 100svh;
}
```How this works
Two paths, one glyph. The dash (12 units) is drawn by default; the check (24 units) is hidden by its own offset. On check they swap offsets, with the check delayed so they don't overlap.
The status word is generated content on a decorative span (aria-hidden): the checkbox label carries the accessible name, the word is visual reinforcement.
Make it yours
- Reverse: add a delay to the dash so it redraws after the check retracts on uncheck.
- Colour per state:
group-has-checked:after:text-*. - Tilt:
-rotate-8→rotate-0for a stricter look. - Localise the status strings (underscores for spaces).
Gotchas — read before shipping
- Dash lengths must match the paths; re-measure if you edit the
dattributes. - Delays apply both ways — tune them so unchecking isn't sluggish.
- Keep the status word out of the accessible name to avoid double announcements.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
SVG stroke transitions are universal.