componentry

Magnet Lines

Component 36

About

An interactive grid of lines that rotate to point toward the cursor, creating a magnetic field effect.

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

Code

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

Usage.tsx

import { MagnetLines } from "@/components/ui/magnet-lines";

export default function Default() {
    return (
        <div className="flex min-h-[500px] w-full items-center justify-center bg-black">
            <MagnetLines
                rows={9}
                columns={9}
                containerSize="60vmin"
                lineColor="#efefef"
                lineWidth="0.8vmin"
                lineHeight="5vmin"
                baseAngle={0}
            />
        </div>
    );
}

Dependencies

More by componentry

View all
  • Scroll Choreography

    Scroll Choreography

    1K
  • Collection Surfer

    Collection Surfer

    797
  • Liquid Glass Carousel

    Liquid Glass Carousel

    412
  • Wheel Carousel

    Wheel Carousel

    372
  • Animated Gradient

    Animated Gradient

    371
  • Circuit Board

    Circuit Board

    156
  • Infinite Image Field

    Infinite Image Field

    108
  • Magnetic Dock

    Magnetic Dock

    101