Magnet lines preview

Magnet lines

A grid of short lines that all turn to point at the cursor.

  • Group
    Patterns
  • Origin
    Adapted · Componentry · source
  • License
    MIT
  • Added
    Oct 18
npx shadcn@latest add @deank/magnet-lines

The registry stays private. Install from the repo with a GitHub token — see the README.

Usage

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

<MagnetLines />

Props

PropTypeDefaultDescription
rows?number9
columns?number9
containerSize?string"320px"Width and height of the grid, any CSS length.
lineColor?string"var(--text-muted)"
lineWidth?string"3px"
lineHeight?string"22px"
baseAngle?number0Angle added to every line, in degrees.
className?string
style?CSSProperties

When to use

Interactive pattern backgrounds that respond to the cursor.

When not to use

Touch-first pages.

Related

Grid background · Ripple