JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<h1>
Студия
</h1>
<input type="radio" name="rb" id="rb1" />
<label for="rb1">1 1</label>
<input type="radio" name="rb" id="rb2" />
<label for="rb2">2 2</label>
<input type="radio" name="rb" id="rb3" />
<label for="rb3">3 3</label>
<input type="radio" name="rb" id="rb4" />
<label for="rb4">4+ 4+</label>
<input type="radio" name="rb" id="rb5" />
<label for="rb5">Дом</label>
<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"],
input[type="radio"] {
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;
}
input[type="radio"] + label::before {
border-radius: 18px;
}
/* Checked */
input[type="checkbox"]:checked + label,
input[type="radio"]:checked + label {
padding-left: 10px;
color: #fff;
}
input[type="checkbox"]:checked + label::before,
input[type="radio"]: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;
}