vibran

Magnetic pill navbar, spring hover indicator

Portuguese name: Menu com pílula magnética

A highlight pill follows the mouse across the menu items on a spring: it is pulled toward the item, leans toward the cursor and returns to the active item when the mouse leaves.

Preview of Magnetic pill navbar, spring hover indicator running live
Copy the promptAdjust colors and speed

When to use it

A top menu for a business site, SaaS or portfolio with 3 to 6 items. Phones have no mouse, so the pill just marks the tapped item and the active link. Lower data-forca for a subtler pull and tweak data-mola for a looser or tighter spring. It also follows Tab, with focus pulling the pill.

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:

<nav data-efeito="menu-pilula-magnetica"><a href="#inicio" aria-current="page">Início</a><a href="#servicos">Serviços</a><a href="#contato">Contato</a></nav>

More navigation effects

All 20 navigation effects →