JSFiddle - React, Tailwind, and code Playground

by Stasweb

HTML

<div class="container">
 <h1>Срок сдачи</h1>
  <input type="checkbox" name="cb" id="cb1" />
  <label for="cb1">Сдан</label>
  <input type="checkbox" name="cb" id="cb2" />
  <label for="cb2">2018 2018</label>
  <input type="checkbox" name="cb" id="cb3" />
  <label for="cb3">2019 2019</label>
  <input type="checkbox" name="cb" id="cb4" />
  <label for="cb4">2020 2020</label>
</div>

CSS

.container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
}
input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  z-index: -1;
}
label {
  position: relative;
  display: inline-block;
  margin-right: 10px;
  margin-bottom: 10px;
  padding-left: 30px;
  padding-right: 10px;
  line-height: 36px;
  cursor: pointer;
}
label::before {
  content: " ";
  position: absolute;
  top: 6px;
  left: 0;
  display: block;
  width: 24px;
  height: 24px;
  border: 2px solid #436ca2;
  border-radius: 4px;
  z-index: -1;
}

/* Checked */
input[type="checkbox"]:checked + label {
  padding-left: 10px;
  color: #fff;
}
input[type="checkbox"]:checked + label::before {
  top: 0;
  width: 100%;
  height: 100%;
  background: #436ca2;
}
/* Transition */
label,
label::before {
  -webkit-transition: .25s all ease;
  -o-transition: .25s all ease;
  transition: .25s all ease;
}