Mohammad Shehadeh

Magnetic Button

Buttons 27

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

    130
  • Rounded Top Footer

    Rounded Top Footer

    112
  • Feature Grid Spotlight Cards

    Feature Grid Spotlight Cards

    111
  • Feature Problem Cards

    Feature Problem Cards

    111
  • Split Login

    Split Login

    109
  • FAQ Two Column

    FAQ Two Column

    95
  • Dithered Shader CTA

    Dithered Shader CTA

    88
  • Comparison Section

    Comparison Section

    88

More in Buttons

View all
  • Button

    Button

    169
  • Texture Button

    Texture Button

    122
  • HeroUI Button Group

    HeroUI Button Group

    1
  • Button

    Button

    88
  • Native Button

    Native Button

    7
  • Button

    Button

    74
  • Button Group

    Button Group

    1
  • Button Group

    Button Group

    5