dsphoebe

Magnetic Button

Component

About

A magnetic metallic button that follows the cursor, sweeps a highlight, and springs back on click.

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 Default() {
  return (
    <div className="flex min-h-80 items-center justify-center bg-background p-10">
      <MagneticButton>Start for free</MagneticButton>
    </div>
  )
}

Dependencies

More by dsphoebe

View all
  • Infinite Logo Marquee

    Infinite Logo Marquee

  • Spotlight Hover Card

    Spotlight Hover Card

  • Text Scramble

    Text Scramble