HTML + CSSInputs

Expanding search bar

A round magnifying glass button that opens into a full search field when you click it.

Settings

16px
1x

Code

<label class="uv-is"><input placeholder="Search…"><svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="6.5"/><path d="M20 20l-4.2-4.2"/></svg></label>

Prompt for AI

Paste it into ChatGPT, Claude or Cursor and it will adapt the block to your project with these settings, even if you don’t use React.

More in Inputs

Where to use it

An expanding search bar saves room in crowded headers. It works well for a blog with a busy menu, the top bar of a small online shop or the mobile header of a news site. At rest it is a round button with a magnifying glass; click it and it springs open into a wide field.

When the field loses focus it shrinks back, so it suits sites where search is a helper, not the main road. On a documentation site or a large catalog, where people search all the time, show a full search bar from the start.