JSFiddle - React, Tailwind, and code Playground
HTML
<div id="animate-me"></div>
<button id="trigger">Animate</button>
CSS
#animate-me{
background: #000;
width: 100px;
height: 50px;
transition: height 2s linear;
}
#animate-me.animate{
height: 100px;
}
JavaScript
var box = document.getElementById("animate-me");
var button = document.getElementById("trigger");
button.addEventListener("click", function(){
box.className += " animate";
});