vibran

Expanding search bar

Portuguese name: Busca que se expande

A round magnifier button that opens into a search field on click, with a suggestion list that filters as you type and works with arrow keys. Esc or clicking outside collapses it when empty.

Preview of Expanding search bar running live
Copy the promptAdjust colors and speed

When to use it

A navigation bar with little room: store, blog, documentation. On phones keep the magnifier collapsed and open it by tap. data-sugestoes takes a fixed list; for server suggestions, listen for the busca event and fill the list yourself. The open width stays reserved, so size --busca-largura to fit.

How to add it to your site

  1. Copy the prompt in the gallery. It comes with the effect's name and the full code. The prompt text is written in Portuguese, and AI builders handle that fine.
  2. Paste it into your AI: Lovable, Claude, Cursor, Bolt or v0.
  3. Done: the AI adds the effect to your project, just like you saw it here.

Use it in HTML

The effect is plain JavaScript, no library. Just put the data-efeito attribute on the element:

<form data-efeito="busca-expansivel" data-sugestoes="Corte,Barba,Sobrancelha"><input type="search" aria-label="Buscar serviços" placeholder="Buscar serviços"></form>

More inputs effects

All 14 inputs effects →