Docs/Fondos

Magnetic Filings

MIT

Thousands 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';
2
3export default function Demo() {
4 return (
5 <ShaderMagneticFilings
6 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

PropTipoPor defectoDescripción
colorAstring"#be1ef9"Rest Color
colorBstring"#6326ff"Excited Color
colorSpace'linear' | 'oklch' | 'oklab' | 'hsl' | 'hsv' | 'lch'"oklab"Color Space
shape'arrow' | 'streak' | 'dot' | 'square' | 'glow'"dot"Shape
countnumber8000Count
sizenumber1Size
restOrientation'random' | 'horizontal' | 'vertical'"random"Rest Orientation
fieldType'dipole' | 'radial'"dipole"Field Type
strengthnumber1.7Strength
reachnumber0.6Reach

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.