23 CSS Checkboxes

Strikethrough Checkbox

Checking the box strikes through the label text with a sliding underline.

Pure CSS MIT licensed

Strikethrough Checkbox the 14th of 23 designs in the 23 CSS Checkboxes collection. The design is implemented in pure CSS — no JavaScript required. Copy the HTML and CSS panels below into your project. Because the demo is pure CSS, it works in any framework or templating engine you happen to use. The design honours prefers-reduced-motion and uses real semantic markup, so it ships accessibility-ready out of the box.

Live preview

Open in playground

The code

<label class="cb-strike">
  <input class="cb-strike__input" type="checkbox" checked />
  <span class="cb-strike__box">
    <svg width="12" height="9" viewBox="0 0 14 11" fill="none">
      <polyline
        points="1,5.5 5,9.5 13,1"
        stroke="white"
        stroke-width="2.2"
        stroke-linecap="round"
        stroke-linejoin="round"
      />
    </svg>
  </span>
  <span class="cb-strike__text">Strikethrough label</span>
</label>
.cb-strike {
  display: inline-flex; align-items: center;
  gap: 10px; cursor: pointer; user-select: none;
}
.cb-strike__input { display: none; }
.cb-strike__box {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.05);
  display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
  color: transparent; overflow: hidden;
  transition: background .25s, border-color .25s,
              color .25s;
}
.cb-strike__box svg {
  transform: scale(0);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.cb-strike__text {
  position: relative; transition: color .3s;
  font-size: 14px;
}
.cb-strike__text::after {
  content: ""; position: absolute;
  left: 0; top: 50%; width: 0; height: 1.5px;
  background: #7c6cff;
  transition: width .35s cubic-bezier(.23,1,.32,1);
}
.cb-strike__input:checked + .cb-strike__box {
  background: #7c6cff; border-color: #7c6cff;
  color: #fff;
}
.cb-strike__input:checked + .cb-strike__box svg {
  transform: scale(1);
}
.cb-strike__input:checked ~ .cb-strike__text {
  color: rgba(255, 255, 255, 0.55);
}
.cb-strike__input:checked ~ .cb-strike__text::after {
  width: 100%;
}

Search CodeFronts

Loading…