JSFiddle - React, Tailwind, and code Playground
HTML
<div class='box'>
<div class='child'>
</div>
</div>
CSS
.box {
width: 50px;
position: relative;
height: 1px;
margin: 0 auto;
}
.child {
width: 50px;
height: 50px;
position: absolute;
top: 5px;
left: 0;
background: white;
transition: top 0.2s linear;
}
.child.low {
top: 200px;
transition: top 0.2s linear 1;
}
JavaScript
$(function() {
$('.child').addClass('low');
});