OPEN-UI

Pixelated Canvas

Convert any image to a pixelated canvas with mouse distortion effects.

Install

Use Open-UI CLI or Shadcn CLI to install the component.

Open-UI CLI

Shadcn CLI

Usage

PropDefaultDescriptionType
srcImage URL to render (subject to CORS).string
width400Canvas display width in pixels.number
height500Canvas display height in pixels.number
variantWhen "static", disables pointer interaction; "interactive" or undefined enables it."static" | "interactive"
cellSize3Size of each sampling cell in CSS pixels.number
dotScale0.9Dot size as a fraction of cell size (0–1).number
shape"square"Shape of each dot: circle or square."circle" | "square"
backgroundColor"#000000"Background color to clear the canvas with before drawing.string
grayscalefalseWhen true, convert image to grayscale before drawing.boolean
classNameAdditional CSS class for the canvas element.string
responsivefalseWhen true, redraw on window resize using the given width/height.boolean
dropoutStrength0.40–1. Higher values remove more dots in low-contrast regions.number
interactivetrueWhen true, enable mouse distortion animation (overridden by variant="static").boolean
distortionStrength3Max per-dot offset in pixels due to distortion.number
distortionRadius80Radius in pixels around the pointer that influences distortion.number
distortionMode"swirl"How dots move near the pointer: repel, attract, or swirl."repel" | "attract" | "swirl"
followSpeed0.20–1 smoothing factor for pointer follow.number
sampleAveragetrueWhen true, average multiple samples per cell instead of center only.boolean
tintColor"#FFFFFF"Color tint (e.g. #0ea5e9 or rgb(14,165,233)).string
tintStrength0.20–1 tint mix amount with original colors.number
maxFps60Cap animation frame rate for performance on large canvases.number
objectFit"cover"Object-fit behavior for the source image: cover, contain, fill, or none."cover" | "contain" | "fill" | "none"
jitterStrength4Random motion amplitude for dots near the pointer.number
jitterSpeed4Speed factor for the random motion.number
fadeOnLeavetrueWhen true, smoothly fade distortion when the pointer leaves (overridden by variant="static").boolean
fadeSpeed0.10–1 smoothing factor for leave fade; higher is faster.number

Related Components