JSFiddle - React, Tailwind, and code Playground
HTML
<div class="member_btn"> <span>Login</span>
<form class="member_block">
<input type="text">
<input type="password">
<input type="submit">
</form>
</div>
CSS
.member_btn {
position: relative;
height: 60px;
width: 50px;
margin: 30px;
}
.member_btn > span {
cursor: pointer;
}
.member_block {
box-shadow: 0 0 1px;
padding: 10px;
position: absolute;
left: 0px;
top: 30px;
z-index: 9999;
display: none;
}
JavaScript
$('.member_btn').on('mouseenter', function() {
$('.member_block', this).show(300);
}).on('mouseleave', function(e) {
if (!$(e.target).is('input')) {
$('.member_block', this).hide(300);
}
});