deleted

Magnet Lines

Component 132

About

An interactive grid of lines responds to cursor movement, creating a magnetic field effect. Each line smoothly rotates to follow the cursor position, resulting in a dynamic and engaging visual pattern. Features: • Interactive cursor tracking • Smooth line rotations • Customizable grid dimensions • Flexible sizing options • Performance optimization • Responsive design • Custom styling support • Dynamic angle calculations • Hardware-accelerated animations • Configurable initial state

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"

function MagnetLinesDemo() {
  return (
    <MagnetLines
      rows={9}
      columns={9}
      containerSize="60vmin"
      lineColor="tomato"
      lineWidth="0.8vmin"
      lineHeight="5vmin"
      baseAngle={0}
      style={{ margin: "2rem auto" }}
    />
  )
}

export { MagnetLinesDemo };

More by deleted

View all
  • Splash Cursor

    Splash Cursor

    1.3K
  • Star Border

    Star Border

    728
  • Tilted Scroll

    Tilted Scroll

    433
  • Waves Background

    Waves Background

    362
  • Squares Background

    Squares Background

    326
  • Prism

    Prism

    218
  • Grid Motion

    Grid Motion

    183
  • Circular Gallery

    Circular Gallery

    173