JSFiddle - React, Tailwind, and code Playground
HTML
<div style="height: 1600px">Scroll down to see the link</div>
<a href="#" id="scroll-to-top">Up Top</a>
JavaScript
$('a#scroll-to-top').click(function() {
$('html, body').animate({
scrollTop: 0
}, 500);
return false;
});