JSFiddle - React, Tailwind, and code Playground

HTML

<div class="test"></div>
<div class="fixed hidden"></div>

CSS

.test {
    width: 100px;
    height: 2000px;
}

.fixed {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 100px;
    height: 50px;
    background: #000;
}

.fixed.hidden {
    display: none;
}

JavaScript

var $win = $(window),
	$fixed = $(".fixed"),
	limit = 300;

function tgl (state) {
    $fixed.toggleClass("hidden", state);
}

$win.on("scroll", function () {
	var top = $win.scrollTop();
    
    if (top < limit) {
        tgl(true);
    } else {
        tgl(false);
    }
});