Mohammad Shehadeh

Magnetic Button

Buttons 20

About

Button that pulls toward the cursor and springs back on leave. Adjustable strength, asChild to wrap a link, respects reduced-motion.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Magnetic Button to your project and fits it to your theme.

Code

How Magnetic Button is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { MagneticButton } from "@/components/ui/magnetic-button";

export default function MagneticButtonDemo() {
  return (
    <div className="flex h-screen w-full items-center justify-center">
      <MagneticButton>Hover Me</MagneticButton>
    </div>
  );
}

Dependencies

More by Mohammad Shehadeh

View all
  • Ecommerce Category Page

    Ecommerce Category Page

    99
  • Feature Problem Cards

    Feature Problem Cards

    99
  • Split Login

    Split Login

    93
  • Feature Grid Spotlight Cards

    Feature Grid Spotlight Cards

    90
  • Comparison Section

    Comparison Section

    81
  • Rounded Top Footer

    Rounded Top Footer

    79
  • Comparison Table

    Comparison Table

    77
  • FAQ Two Column

    FAQ Two Column

    76

More in Buttons

View all
  • Texture Button

    Texture Button

    108
  • Button

    Button

    14
  • Notification Button

    Notification Button

    117
  • HeroUI Button Group

    HeroUI Button Group

    2
  • Eclipse Button

    Eclipse Button

    44
  • Button Save

    Button Save

    50
  • App Store Button

    App Store Button

    484
  • Base Button

    Base Button

    1