Skip to content
OwnlyPlans

Element

Magnetic Button

A call-to-action that leans toward the pointer and springs back when it leaves.

Remix

Preview and code

Markdown
Buttons

Install

shadcn CLI
npx shadcn@latest add https://ownlyplans.com/r/bhaskar/magnetic-button.json

Adds the React files to components/ownlyplans/ in a project set up with shadcn and Tailwind CSS. Or copy them from the Code tab.

About

The button follows the cursor by a fraction of the distance, so it feels pulled without running away. Motion is skipped when the visitor prefers reduced motion.

Your AI tool
Starter prompt

		

Download the plan