Toggle Sidebar B
AppearanceLight & dark mode D

Magnet Lines

Animated field lines bend toward the cursor.

Default

Move the pointer anywhere on the page and every line turns toward it. Rows, columns, base angle and color are wired to the controls underneath.

Dark previewReplay previewOpen in new tab

Customize

Rows10
Columns12
Base Angle-10
Line Color

API Reference

MagnetLines

PropTypeDefaultDescription
rowsnumber9Number of grid rows.
columnsnumber9Number of grid columns.
containerSizestring80vminSpecifies the width and height of the entire grid container.
lineColorstring#efefefColor for each line (the <span> elements).
lineWidthstring1vminSpecifies each line's thickness.
lineHeightstring6vminSpecifies each line's length.
baseAnglenumber-10Initial rotation angle (in degrees) before pointer movement.

Accessibility

Keyboard shortcuts and ARIA behavior.

  • The lines are decorative spans with no content, so assistive technology skips them.
  • The effect tracks the pointer only. Nothing inside it takes focus.