Magnetic Filings
MITThousands of tiny iron filings scattered on paper that swing to align with a magnetic field around the cursor, tracing out the field lines — a dipole whose axis follows the cursor's motion draws the classic two-lobed swirl, and every sweep of the magnet sends a glowing wave of filings flipping and settling
Cargando shader…
Ajústalo
8000
1
1.7
0.6
Instalación
Terminal
npx shadcn@latest add https://<tu-dominio>/r/shader-magnetic-filings.json
Crea components/bastard/ShaderMagneticFilings.tsx e instala shaders. Más opciones
Uso
Demo.tsx
1import ShaderMagneticFilings from '@/components/bastard/ShaderMagneticFilings';23export default function Demo() {4 return (5 <ShaderMagneticFilings6 colorA="#be1ef9"7 colorB="#6326ff"8 colorSpace="oklab"9 shape="dot"10 count={8000}11 size={1}12 restOrientation="random"13 fieldType="dipole"14 strength={1.7}15 reach={0.6}16 />17 );18}
Props
| Prop | Tipo | Por defecto | Descripción |
|---|---|---|---|
| colorA | string | "#be1ef9" | Rest Color |
| colorB | string | "#6326ff" | Excited Color |
| colorSpace | 'linear' | 'oklch' | 'oklab' | 'hsl' | 'hsv' | 'lch' | "oklab" | Color Space |
| shape | 'arrow' | 'streak' | 'dot' | 'square' | 'glow' | "dot" | Shape |
| count | number | 8000 | Count |
| size | number | 1 | Size |
| restOrientation | 'random' | 'horizontal' | 'vertical' | "random" | Rest Orientation |
| fieldType | 'dipole' | 'radial' | "dipole" | Field Type |
| strength | number | 1.7 | Strength |
| reach | number | 0.6 | Reach |
Aquí aparecen las props ajustables. El componente acepta más: revisa el código fuente.
Créditos
Basado en Magnetic Filings · Shaders.com, adaptado para BSTRD UI.Licencia: MIT. Puedes usarlo, modificarlo y venderlo, conservando el aviso de copyright que va dentro del archivo.