Components
Button that leans toward the cursor with spring physics inside a configurable radius, and stays still on touch devices. Respects prefers-reduced-motion.

"use client";
import Component from "@/components/ui/magnetic-button";
export default function DemoOne() {
return (
<div className="flex min-h-[440px] w-full items-center justify-center bg-background p-10">
<div className="w-full max-w-lg rounded-2xl border bg-card p-10 shadow-sm">
<p className="font-semibold text-foreground text-sm">Magnetic Button</p>
<p className="mt-1 text-muted-foreground text-xs">
Move the cursor near a button — it leans toward you within its radius,
then springs back.
</p>
<div className="mt-8 flex flex-wrap items-center justify-center gap-4">
<Component>Get started</Component>
<Component strength={40} variant="outline">
Stronger pull
</Component>
<Component radius={60} variant="secondary">
Tight radius
</Component>
<Component disabled variant="ghost">
Disabled
</Component>
</div>
</div>
</div>
);
}