Back to components
ComponentEffectFree

Magnetic Field Lines React component

A field of iron filings that line up around a magnet you move: hundreds of short strokes swing round to follow a real dipole field, curving into the classic loops, glowing warm on the north side and cool on the south, and a click flips the poles.

About the Magnetic Field Lines component

Magnetic Field Lines is a background of iron filings that respond to a magnet — your pointer. Hundreds of short strokes swing round to follow a real magnetic field, curving into the loops you'd see on a school bench, warm on the north side, cool on the south, and fading out with distance.

The magnet turns to point the way you move it, the filings swing rather than snap, and a click flips the poles so the whole field turns around. With no pointer, the magnet sits in the middle and slowly rotates.

When to use it

Use it for physics, energy and hardware brands, developer tools with a 'pull' or 'attraction' story, science education sites, or as a calm but alive hero background.

It's busy edge to edge, so set content in one corner or on a solid panel.

Installation

Add the Magnetic Field Lines component to your project with the shadcn CLI. It lands in components/magnetic-field-lines.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/magnetic-field-lines

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install clsx tailwind-merge

More Effect components

Gooey Blob Merge
Free
Chrome Liquid Logo
Free
Cursor Ribbons
Free
Peel-off Sticker
Free
Reactive Cube Grid
Free
Edge Fade Blur
Free