vibran

Button that expands into an email field

Portuguese name: Botão que vira campo de e-mail

A pill with the invitation (Get the newsletter). On click it widens into an email field with the send button inside. An invalid email shakes and warns; a valid one shows a spinner and then a check with the confirmation.

Preview of Button that expands into an email field running live
Copy the promptAdjust colors and speed

When to use it

Email capture in a hero, footer or end of an article, when an open form would take too much room. The field only appears once the person shows interest, which keeps the page cleaner. Say in the button what they get ("Notify me about the bake"), not "Submit". Without listening to the "enviar" event it only simulates; in production, connect it to your email service.

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="botao-email" data-rotulo="Receber o boletim" data-placeholder="seu@email.com" data-ok="Pronto, confira sua caixa de entrada."></form>
<script>
  document.querySelector("[data-efeito=botao-email]").addEventListener("enviar", (e) => {
    e.preventDefault();
    fetch("/api/inscrever", { method: "POST", body: JSON.stringify({ email: e.detail.email }) })
      .then(e.detail.ok, () => e.detail.erro("Não deu para inscrever agora."));
  });
</script>

More buttons effects

All 41 buttons effects →