JSFiddle - React, Tailwind, and code Playground

HTML

<div class="content show">
    <form method="post" action="">
        <label>Lastname
            <input type="text" name="lastname">
        </label>
        <label>Firstname
            <input type="text" name="firstname">
        </label>
    </form>
</div>

CSS

.content{
    overflow:hidden;
}

.content.show{
    background:#ccc;
    height:auto; 
    transition:0.5s;
    -webkit-transform:translateY(0);
}

.content.hidden{
    height:60px;
    transition:0.5s;
    -webkit-transform:translateY(0);
}

JavaScript

$(document).click(function(){
    $(".content").toggleClass("hidden");
});