JSFiddle - React, Tailwind, and code Playground
HTML
<div class="col-md-9 col-md-offset-3 reg-login-line">
<div class="onoff">
<input type="checkbox" autocomplete="off" id="register_account" name="register_account" checked="checked" value="1" onclick="return Onepage.showFields( this.checked, new Array('opc_password', 'opc_password2') );">
<label for="register_account"></label>
</div>
<label for="register_account" class="as-text">Зарегистрироваться</label>
</div>
CSS
* {
box-sizing: border-box;
}
.onoff {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
display: inline-block;
width: auto;
margin: 0 0.3em 0 0;
padding: 0;
vertical-align: middle;
}
.onoff input {
display: none;
}
.onoff label {
overflow: hidden;
cursor: pointer;
height: 24px;
padding: 0;
line-height: 20px;
border: 1px solid #ddd;
border-radius: 20px;
background-color: #FFFFFF;
transition: background-color 0.25s ease;
margin: 0;
width: 37px;
position: relative;
display: block;
}
.onoff label:before {
content: "";
display: block;
width: 20px;
height: 20px;
margin: 0px;
background: #FFFFFF;
position: absolute;
top: 1px;
bottom: 0;
right: 14px;
border: 0;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
transition: right 0.25s ease;
-webkit-box-shadow: 0 2px 3px 0px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 2px 3px 0px rgba(0, 0, 0, 0.3);
box-shadow: 0 2px 3px 0px rgba(0, 0, 0, 0.3);
}
.onoff input:checked + label {
background-color: #49E845;
}
.onoff input:checked + label:before {
right: 1px;
}
.as-text {
vertical-align: middle;
}