JSFiddle - React, Tailwind, and code Playground

by oceog

HTML

<label class="switchable">
    <input type="checkbox" />
    <div id="a"></div>
</label>

CSS

#a {
    width:100px;
    height:100px;
    position:absolute;
    top:0;
    left: 0;
    border: 1px solid black;
    transition: all 0.5s;
}
.switchable input {
    display:none;
}
.switchable input:checked+#a {
    top:100px;
    left:50px
}