A customizable stretch search input component built with Tailwind CSS.
To use this component in your project, copy the code and paste it into your HTML file. You can customize the component by modifying the Tailwind CSS classes.
<div class="relative">
<input
placeholder="Search..."
class="input shadow-lg focus:border-2 border-gray-300 bg-white px-5 py-3 rounded-xl w-56 transition-all focus:w-96 outline-none"
name="search"
type="search"
/>
<svg
class="size-6 absolute top-3 right-3 text-gray-500"
stroke="currentColor"
stroke-width="1.5"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
stroke-linejoin="round"
stroke-linecap="round"
></path>
</svg>
</div>This component is fully responsive and adapts to different screen sizes. Use the viewport controls above to preview how it looks on different devices.
Optimized for screens smaller than 640px
Optimized for screens between 640px and 1024px
Optimized for screens larger than 1024px