PParable
All components

Magnet Lines

Visual Effects

A grid of bars that rotate to point at the cursor like iron filings around a magnet. Pointer-driven, no rAF loop; holds base angle under reduced-motion.

Inspired by React Bits — Magnet Lines — independently built, not affiliated. Attribution policy

Installation

npx shadcn@latest add https://parable-three.vercel.app/r/magnet-lines.json

Runs the shadcn CLI — the component source is copied intocomponents/parable/magnet-lines.tsx. You own it from there.

Usage

The exact code rendering the preview above.

<MagnetLines className="h-56 w-56" rows={9} columns={9} color="#8b5cf6" />

Props

MagnetLinesProps extends React.HTMLAttributes<HTMLDivElement>

PropTypeDefaultDescription
rowsnumber9
columnsnumber9
lineWidthstring"0.5vmin"Line container size, any CSS length.
lineHeightstring"4vmin"
colorstring"#8b5cf6"
baseAnglenumber-10Base (resting) rotation in degrees.