JSFiddle - React, Tailwind, and code Playground

HTML

<div>
    some text and an inline block element <span></span>
</div>
<br>
<button>
    Animate for 1 second
</button>

CSS

span {
    display: inline-block;
    width: 10px;
    height: 50px;
    background: red;
}
div {
    display: inline-block;
}

JavaScript

$('button').click(function() {
    $('div').animate({ width: 300 }, 1000);
});