CSS To-Do Checklist

A to-do list with round checkboxes where finished tasks get a line drawn through them and fade out.

  • todo
  • task list
  • checkbox
  • strikethrough
  • done
  • checklist
HTML
<fieldset class="todo-list">
  <legend>Today</legend>
  <label><input type="checkbox" checked><span>Review pull request</span></label>
  <label><input type="checkbox"><span>Write release notes</span></label>
  <label><input type="checkbox"><span>Book team lunch</span></label>
</fieldset>
CSS
.todo-list {
  display: grid;
  gap: 4px;
  width: 240px;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px -10px rgba(113, 63, 18, 0.35);
  color: #422006;
  font-family: system-ui, sans-serif;
}

.todo-list legend {
  float: left;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 800;
}

.todo-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  cursor: pointer;
}

.todo-list input {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid #facc15;
  border-radius: 50%;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.todo-list input::before {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  transform: scale(0);
  transition: transform 0.15s ease;
}

.todo-list input:checked {
  border-color: #ca8a04;
  background: #ca8a04;
}

.todo-list input:checked::before {
  transform: scale(1);
}

.todo-list input:focus-visible {
  outline: 2px solid #ca8a04;
  outline-offset: 2px;
}

.todo-list span {
  background: linear-gradient(#a16207, #a16207) no-repeat 0 55% / 0 1.5px;
  transition: background-size 0.3s ease, color 0.3s ease;
}

.todo-list input:checked + span {
  background-size: 100% 1.5px;
  color: #a8a29e;
}

@media (prefers-reduced-motion: reduce) {
  .todo-list span,
  .todo-list input::before {
    transition: none;
  }
}

About this CSS To-Do Checklist

This CSS To-Do Checklist is 83 lines of pure CSS (1.4 KB) with no JavaScript and no dependencies. It uses transitions, transforms, linear gradients and box shadows. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.

CSS features used

Customize it

The colors in this snippet. Search and replace them to match your brand:

  • #fff
  • #422006
  • #facc15
  • #ca8a04
  • #a16207
  • #a8a29e

How to use this to-do checklist

  1. Copy the HTML and paste it where you want the element to appear.
  2. Copy the CSS into your stylesheet, or inside a <style> tag.
  3. Keep the .todo-list class name, or rename it in both places. Then tweak colors, sizes and timing to match your design.
  4. Using React or Next.js? Change class to className in the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).

Building with an AI tool?

“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.

Feedback