JSFiddle - React, Tailwind, and code Playground
by Matt Hopkins
HTML
<div></div>
<button>
click
</button>
CSS
div {
width: 300px;
height: 0px;
background: darkblue;
border-radius: 10px;
margin-left: 50px;
margin-top: 50px;
}
div {
transition: height 0.5s linear;
}
div.visible {
height: 200px;
}
JavaScript
$('button').on('click', function(){
$('div').toggleClass('visible');
});