JSFiddle - React, Tailwind, and code Playground
HTML
<div class="block">
<div class="block-pannel">
<h2>Hi</h2>
</div>
</div>
CSS
.block{
position: relative;
margin: 50px;
width: 200px;
height: 200px;
overflow: hidden;
background-color: #85868D;
border-radius: 3px;
cursor: pointer;
}
.block-pannel{
display: flex;
align-items: center;
justify-content: center;
position: absolute:
top: 0;
left: 0;
width: inherit;
height: inherit;
background-color: #333;
border-radius: 3px;
transform: translate(0, -100%);
transition: .5s ease;
}
.block-pannel h2{
font-size: 25px;
color: #fff;
}
.block:hover .block-pannel{
transform: translate(0, 0);
}