23 CSS Checkboxes

Retro Pixel Checkbox

An 8-bit checkmark built from SVG rects with crispEdges. Scales in with a pop on check.

Pure CSS MIT licensed

Retro Pixel Checkbox the 13th 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-pixel">
  <input class="cb-pixel__input" type="checkbox" checked />
  <span class="cb-pixel__box">
    <svg class="cb-pixel__svg" viewBox="0 0 10 8" shape-rendering="crispEdges" fill="#1ed98a">
      <rect x="0" y="4" width="2" height="2" />
      <rect x="2" y="6" width="2" height="2" />
      <rect x="4" y="4" width="2" height="2" />
      <rect x="6" y="2" width="2" height="2" />
      <rect x="8" y="0" width="2" height="2" />
    </svg>
  </span>
  <span>Retro pixel checkbox</span>
</label>
.cb-pixel {
  display: inline-flex; align-items: center;
  gap: 10px; cursor: pointer; user-select: none;
}
.cb-pixel__input { display: none; }
.cb-pixel__box {
  width: 26px; height: 26px;
  border: 3px solid #1ed98a;
  display: flex; align-items: center;
  justify-content: center; overflow: hidden;
  transition: background .25s;
}
.cb-pixel__svg {
  width: 14px; height: 11px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  opacity: 0; transform: scale(.5);
  transition: opacity .2s,
    transform .3s cubic-bezier(.34,1.56,.64,1);
}
.cb-pixel__input:checked + .cb-pixel__box {
  background: rgba(30,217,138,.15);
}
.cb-pixel__input:checked
  + .cb-pixel__box .cb-pixel__svg {
  opacity: 1; transform: scale(1);
}

Search CodeFronts

Loading…