JSFiddle - React, Tailwind, and code Playground
HTML
<div class="checkbutton">
<input type="checkbox" value="None" id="slideThree" name="check"/>
<label for="slideThree"></label>
<span class = "leftcheck">Hombre</span>
<span class = "rightcheck">Mujer</span>
</div>
CSS
body
{
background: black;
}
/* Original: http://cssdeck.com/labs/css-checkbox-styles */
input[type=checkbox]
{
visibility: hidden;
}
/* SLIDE THREE */
.checkbutton
{
width: 150px;
height: 28px;
background: #333;
margin: 20px auto;
border-radius: 6px;
position: relative;
box-shadow: inset 0px 0px 2px black;
}
.checkbutton .leftcheck
{
position: absolute;
left: 0px;
width: 50%;
text-align: center;
line-height: 28px;
color: CornflowerBlue;
}
.checkbutton .rightcheck
{
position: absolute;
right: 0px;
width: 50%;
text-align: center;
line-height: 28px;
color: HotPink;
}
/* Ancho del boton */
.checkbutton label
{
display: block;
width: 50%;
height: 28px;
border-radius: 6px;
/*
-webkit-transition: all .4s ease;
-moz-transition: all .4s ease;
-o-transition: all .4s ease;
-ms-transition: all .4s ease; */
transition: all .4s ease;
cursor: pointer;
position: absolute;
top: 0px;
left: 50%;
z-index: 1;
box-shadow: 0px 0px 1px 0px white;
background-color: rgba(255,255,255,0.8);
}
.checkbutton input[type=checkbox]:checked + label
{
left: 0px;
}