JSFiddle - React, Tailwind, and code Playground
HTML
<button>Example</button>
<div></div>
CSS
div { width: 100px; height: 100px; background: black }
JavaScript
$('button').click(function () {
$('div').animate({
opacity: 0.25
}, 2000, $.fn.hide.bind($(this)));
});