kevingirelli

Magnetic

Buttons 7

About

A wrapper that pulls its child content toward the cursor while hovered and springs it back on release, for magnetic buttons and links.

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

Code

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

Usage.tsx

import { Magnetic } from "@/components/ui/magnetic";

export default function MagneticDemo() {
  return (
    <div className="flex min-h-[400px] w-full items-center justify-center">
      <Magnetic strength={0.3}>
        <button className="rounded-full bg-primary px-8 py-4 text-sm font-medium text-primary-foreground shadow-lg">
          Get started
        </button>
      </Magnetic>
    </div>
  );
}

More by kevingirelli

View all
  • Aurora

    Aurora

    80
  • QR Code

    QR Code

    67
  • Warp Gradient

    Warp Gradient

    55
  • FAQ Section

    FAQ Section

    53
  • Corner Frame

    Corner Frame

    43
  • Animated Border

    Animated Border

    43
  • Wave Text

    Wave Text

    41
  • Spotlight

    Spotlight

    33

More in Buttons

View all
  • Texture Button

    Texture Button

    98
  • Button

    Button

    1
  • Button

    Button

    68
  • Eclipse Button

    Eclipse Button

    3
  • Button

    Button

    65
  • App Store Button

    App Store Button

    458
  • HeroUI Button Group

    HeroUI Button Group

    2
  • Base Button

    Base Button

    4