Magnetic button

From nexu-io/motion-anything · View interactive version

Magnetic button is an AI agent skill from the GitHub repository nexu-io/motion-anything. Make a primary button feel alive by gently pulling it toward the cursor as it approaches, then springing back. Keep it subtle and reserve it for one or two primary actions. Disabled on touch and under prefers-reduced-motion. Do not use it on dense UIs full of buttons.

How to use this skill

Skill file

magnetic-button

A button that leans toward the cursor, then springs back. Part of

motion-anything; obeys MOTION-SPEC.md.

When to use it

When NOT to use it (restraint)

How to apply

  1. Copy magnetic-button.css and magnetic-button.js into the project, and link them.
  2. Mark the button:

```html

<button class="magnetic" data-magnet-strength="0.3">Get started</button>

```

  1. Auto-attaches to .magnetic. Keep strength small (~0.2–0.4) so the pull stays subtle.

Accessibility & performance

Framework notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.