Skip to content

Magnetic Button

A button that moves slightly when hovered, creating a magnetic effect. It follows the cursor within a set radius and returns to its original position when the cursor leaves. Use it to add subtle visual feedback to interactive elements.

byEdu Calvofrom Smoothui

Loading preview

Installation

terminal
pnpm dlx layro-cli add @educlopez/magnetic-button

New project? Start with init. Writes third-party code and installs packages with scripts off.

Code

Demo

Sign in to see the code

Free, with GitHub, Google or email. The install command above works without an account.

Sign in

Versions

  1. 1.0.0 · current

    Nov 7, 2026

    First release.

Similar components