Mohammad Shehadeh

Magnetic Button

Buttons 24

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

    117
  • Feature Problem Cards

    Feature Problem Cards

    107
  • Split Login

    Split Login

    103
  • Feature Grid Spotlight Cards

    Feature Grid Spotlight Cards

    100
  • Rounded Top Footer

    Rounded Top Footer

    93
  • Comparison Section

    Comparison Section

    86
  • FAQ Two Column

    FAQ Two Column

    85
  • Comparison Table

    Comparison Table

    82

More in Buttons

View all
  • Button

    Button

    20
  • Button

    Button

    3
  • Button Group

    Button Group

    18
  • Button

    Button

    149
  • Icon Label Subtext Button

    Icon Label Subtext Button

    69
  • Button

    Button

    9
  • Button

    Button

    37
  • Texture Button

    Texture Button

    113