MediaClient component
Pixel Displacement
An image breaks into displaced tiles around the pointer and settles back into place.
Move across the image
Move over the surface to displace the image
Usage
tsx
import { PixelDisplacement } from "@/components/effects/pixel-displacement"
<PixelDisplacement src="/your-image.webp" alt="Project cover" columns={18} strength={26} />API reference
| Prop | Type / default | Description |
|---|---|---|
| src / alt | string | Image URL and accessible description. Use local or CORS-enabled images when exporting canvas data. |
| columns | number = 18 | Horizontal tile count, constrained to 4–64 for rendering. |
| strength | number = 26 | Maximum pointer displacement in CSS pixels. |
Use className to adjust layout and styling. New effects respect system reduced-motion preferences and the preview motion setting.