Julien Thibeaut

Magnetic

Buttons 80

About

A magnetic effect for elements that allows them to be attracted to the mouse cursor.

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';

function MagneticBasic() {
  return (
    <Magnetic>
      <button
        type='button'
        className='inline-flex items-center rounded-md border border-zinc-100 bg-transparent px-4 py-2 text-sm text-zinc-950 transition-all duration-300 hover:bg-zinc-100 dark:border-zinc-900 dark:bg-transparent dark:text-zinc-50 dark:hover:bg-zinc-600'
      >
        <span>Submit</span>
      </button>
    </Magnetic>
  );
}

export { MagneticBasic }

Dependencies

More by Julien Thibeaut

View all
  • Dock

    Dock

    3.2K
  • Text Effect

    Text Effect

    1.7K
  • Infinite Slider

    Infinite Slider

    1.5K
  • Text Shimmer

    Text Shimmer

    1.3K
  • Text Scramble

    Text Scramble

    1.1K
  • Progressive blur

    Progressive blur

    697
  • Glow Effect

    Glow Effect

    623
  • Tailwind CSS Background Snippet

    Tailwind CSS Background Snippet

    585

More in Buttons

View all
  • Texture Button

    Texture Button

    101
  • App Store Button

    App Store Button

    471
  • Button

    Button

    14
  • Button

    Button

    8
  • Button Group

    Button Group

  • Button

    Button

    75
  • Button

    Button

    66
  • Native Button

    Native Button

    7