Mohammad Shehadeh

Magnetic Button

Buttons 11

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
  • Feature Problem Cards

    Feature Problem Cards

    90
  • Feature Grid Spotlight Cards

    Feature Grid Spotlight Cards

    73
  • Ecommerce Category Page

    Ecommerce Category Page

    72
  • Split Login

    Split Login

    68
  • Comparison Section

    Comparison Section

    65
  • Dithered Shader CTA

    Dithered Shader CTA

    64
  • Comparison Table

    Comparison Table

    64
  • FAQ Two Column

    FAQ Two Column

    63

More in Buttons

View all
  • Button

    Button

    5
  • Texture Button

    Texture Button

    97
  • Button Group

    Button Group

  • Eclipse Button

    Eclipse Button

    39
  • Button

    Button

    4
  • HeroUI Button Group

    HeroUI Button Group

  • Base Button

    Base Button

    4
  • App Store Button

    App Store Button

    458