JSFiddle - React, Tailwind, and code Playground
HTML
<div class="checkbox-wrapper-33">
<label class="checkbox">
<input class="checkbox__trigger visuallyhidden" name="WAV" type="checkbox" checked />
<span class="checkbox__symbol">
<svg aria-hidden="true" class="icon-checkbox" width="28px" height="28px" viewBox="0 0 28 28" version="1" xmlns="http://www.w3.org/2000/svg">
<path d="M4 14l8 7L24 7"></path>
</svg>
</span>
<p class="checkbox__textwrapper">WAV</p>
</label>
<label class="checkbox">
<input class="checkbox__trigger visuallyhidden" name="MP3" type="checkbox" />
<span class="checkbox__symbol">
<svg aria-hidden="true" class="icon-checkbox" width="28px" height="28px" viewBox="0 0 28 28" version="1" xmlns="http://www.w3.org/2000/svg">
<path d="M4 14l8 7L24 7"></path>
</svg>
</span>
<p class="checkbox__textwrapper">MP3</p>
</label>
</div>
CSS
.checkbox-wrapper-33 {
--s-xsmall: 0.625em;
--s-small: 1.2em;
--border-width: 1px;
--c-primary: #3a3a3c;
--c-primary-20-percent-opacity: rgb(55 55 55 / 20%);
--c-primary-10-percent-opacity: rgb(55 55 55 / 10%);
--t-base: 0.4s;
--t-fast: 0.2s;
--e-in: ease-in;
--e-out: cubic-bezier(.11,.29,.18,.98);
}
.checkbox-wrapper-33 .visuallyhidden {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.checkbox-wrapper-33 .checkbox {
display: flex;
align-items: center;
justify-content: flex-start;
}
.checkbox-wrapper-33 .checkbox + .checkbox {
margin-top: var(--s-small);
}
.checkbox-wrapper-33 .checkbox__symbol {
display: inline-block;
display: flex;
margin-right: calc(var(--s-small) * 0.7);
border: var(--border-width) solid var(--c-primary);
position: relative;
border-radius: 0.1em;
width: 1.5em;
height: 1.5em;
transition: box-shadow var(--t-base) var(--e-out), background-color var(--t-base);
box-shadow: 0 0 0 0 var(--c-primary-10-percent-opacity);
}
.checkbox-wrapper-33 .checkbox__symbol:after {
content: "";
position: absolute;
top: 0.5em;
left: 0.5em;
width: 0.25em;
height: 0.25em;
background-color: var(--c-primary-20-percent-opacity);
opacity: 0;
border-radius: 3em;
transform: scale(1);
transform-origin: 50% 50%;
}
.checkbox-wrapper-33 .checkbox .icon-checkbox {
width: 1em;
height: 1em;
margin: auto;
fill: none;
stroke-width: 3;
stroke: currentColor;
stroke-linecap: round;
stroke-linejoin: round;
stroke-miterlimit: 10;
color: var(--c-primary);
display: inline-block;
}
.checkbox-wrapper-33 .checkbox .icon-checkbox path {
transition: stroke-dashoffset var(--t-fast) var(--e-in);
stroke-dasharray: 30px, 31px;
stroke-dashoffset: 31px;
}
...