JSFiddle - React, Tailwind, and code Playground

HTML

<div class="block"></div>
<button>Click</button>

CSS

.block{
    position:absolute;
    bottom:10px;
    right:10px;
    left:10px;
    height:100px;
    background:gray;
    -webkit-transition: -webkit-transform 2s;
}
.block.hide{
    -webkit-transform:translateY(-10000px);
}

JavaScript

document.querySelector("button").addEventListener("click",function(){
    document.querySelector(".block").classList.add("hide");
});