Iron Filings Field
Thousands of steel needles on paper swing with a little inertia to align with the magnetic field of a few poles; the pointer carries a north pole and clicks drop new poles.
Try it: Move to carry a pole; click to pin it (you get the opposite one). Double-click clears.
Brings its own background. Paints its own paper (light) / graphite (dark) canvas and adapts on its own: theme='auto' follows the nearest .dark / .light ancestor. Force a look with theme and restyle the frame with className.
Installation
Install with the shadcn CLI:
npx shadcn@latest add https://www.framekitui.live/r/iron-filings-field.jsonOr, with the @framekit namespace registered: npx shadcn@latest add @framekit/iron-filings-field. You can also copy the source into components/ui/iron-filings-field.tsx (view on GitHub).
Usage
import { IronFilingsField } from '@/components/ui/iron-filings-field'Props
| Prop | Type | Default | Notes |
|---|---|---|---|
spacing | number | 16 | Grid spacing of filings (10–40px). |
interactive | boolean | true | Pointer pole, click-to-drop and the pole buttons. |
drift | boolean | true | Idle poles orbit slowly. |
children | ReactNode | — | Content layered over the field. |
theme | 'auto' | 'light' | 'dark' | 'auto' | auto follows the nearest .dark / .light ancestor; light / dark force a palette. |
Related Animated Backgrounds components
- Glow Arc Hero
A rainbow of glossy tiles fans in around a centred headline; each tile breathes its own coloured halo while the arc sways and tilts toward the pointer.
- Flicker Dot Field
A calm LED-like matrix: each mark drifts between brightness levels on its own clock so the field shimmers without syncing, and marks near the pointer glow. Set flicker to 0 for a still dot pattern.…
- Prism Tidal Field
Soft lilac tidal bands that bend toward pointer velocity.
- Horizon Grid Field
A quiet perspective floor gliding toward you under a softly lit horizon. Hairline grid lines fade into haze, a low glow sits on the vanishing line and, in dark scopes, still stars hang above. Pure…
- Constellation Breathing Grid
Sparse nodes breathe and link when close.
- Grain Gradient Field
A full-bleed background of four slowly drifting colour blobs under real SVG film grain, with a pointer-following glow. Four palettes, light and dark tuned, still when reduced motion is on.