vibran

Add to cart stepper button

Portuguese name: Botão que vira contador

The Add button turns into a stepper with minus, number and plus, like in delivery apps. The number rolls on each tap, the plus dims at the limit, and when it gets back to zero it becomes a button again.

Preview of Add to cart stepper button running live
Copy the promptAdjust colors and speed

When to use it

Menus, shops and shopping lists where people pick quantities without leaving the page. One tap adds the first item and the button itself becomes the control, with no new screen. Set data-max to match stock and give each item a data-nome so a screen reader can say "Add one more empanada". Use el.quantidade(0) to reset from code.

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:

<div data-efeito="botao-quantidade" data-rotulo="Adicionar" data-max="9" data-nome="empanada"></div>
<script>
  document.querySelector("[data-efeito=botao-quantidade]").addEventListener("mudou", (e) => {
    console.log("quantidade:", e.detail.quantidade);
  });
</script>

More buttons effects

All 41 buttons effects →