JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<div class="back-to-top">Back to top</div>

CSS

html {
  height: 1000%;
}
.back-to-top {
  display: none;
  position: fixed;
  bottom:0;
	width: 100%;
	border: 2px solid #000;
	text-align: center;
	background: rgb(0,0,0);
	color: #fff;
}

JavaScript

$(document).ready(function () {
        $(window).scroll(function () {
            var offset = document.documentElement.scrollTop;
            var $back = $('.back-to-top');
            if (offset >500 || $(window).scrollTop() > 500) {
                $back.show();
            } else {
                $back.hide();
            }
        });
}