Phuc Bui

Magnetic

Buttons

About

Add smooth magnetic attraction effects for any HTML elements.

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 DemoOne() {
  return (
        <div className="h-screen w-full flex items-center justify-center bg-slate-50">
            <Magnetic distance={50} attraction={0.5}>
                <button
                    className="relative inline-flex items-center justify-center px-8 py-4 rounded-2xl bg-blue-600 hover:bg-blue-700 text-white font-bold shadow-lg shadow-blue-500/50 transition-colors duration-200"
                >
                    HOVER ON ME
                </button>
            </Magnetic>
        </div>
    );
}

Dependencies

More by Phuc Bui

View all
  • Moving Border

    Moving Border

    464
  • Draw SVG

    Draw SVG

    1
  • Infinite Image Carousel

    Infinite Image Carousel

    1
  • Shimmer Layer

    Shimmer Layer

  • Text Ripple

    Text Ripple

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