JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-3.4.1.slim.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css">
<!--
Bootstrap docs: https://getbootstrap.com/docs
-->
<div class="container">
<div class="row">
<div class="col col-10">
Column 1 - Make search input overflow me!
</div>
<div class="col d-flex justify-content-end align-self-center">
<div class="search-area">
<form class="page-searchform" action="" method="get">
<label for="headerSearch" class="visually-hidden"></label>
<input name="" id="headerSearch" class="header-search form-control" type="search" placeholder="Search...">
<button class="btn header-search-btn" type="submit" id="headerSearchBtn">Go
</button>
</form>
</div>
</div>
</div>
</div>
CSS
.search-area {
transition: all .3s ease-in;
width: 3rem
}
.search-area:focus-within .header-search{
transition: all .3s ease-in;
width: 500px;
}
.header-search{
}
.page-searchform {
position: relative
}
.search-area:hover .header-search{
transition: all .3s ease-in;
width: 500px;
}
.header-search {
padding-right: 2rem;
border: 0;
background-color: red;
position:absolute;
right:0;
width: 100px;
}
.header-search-btn {
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
}
/* Presentation onæly */
.row {
background: #f8f9fa;
margin-top: 20px;
}
.col {
padding: 10px;
border: 1px solid #ccc;
}