JSFiddle - React, Tailwind, and code Playground
HTML
<div></div>
CSS
div{
width: 100px;
height: 100px;
background: #000;
-webkit-transition: 0.3s;
transition: 0.3s;
}
.active{
width: 200px;
background: #00f;
}
JavaScript
$(document).ready(function() {
$("div").click(function() {
$(this).toggleClass('active');
});
});