Unfocused
An image or video under a directional lens blur that ramps from sharp at one edge to heavy blur at the other, with red and blue split apart and a fixed grain in the shadows. On mount the blur, grain and distortion run to zero over two seconds, so the picture pulls into focus. One WebGL fragment shader, no dependencies.
npx shadcn@latest add @compronents/unfocusedInstalls from ui.aryank.space. Needs a registry token and a one-time @compronents entry in components.json. The docs walk through both.
Checking access…
| Prop | Type | Default | Description |
|---|---|---|---|
| src / type | string / "image" | "video" | hosted image / "image" | Media URL and kind. Changing either rebuilds the scene. |
| alt | string | — | Image description, set as the canvas label. |
| fit / loop | "cover" | "contain" / boolean | "cover" / true | How the media fills the box, and whether video loops. |
| blur / angle / falloff | number / number / number | 200 / 45 / 1 | Blur strength (0 to 1000), the direction it grows in degrees, and how much it ramps: 0 blurs evenly, 1 runs from sharp at the origin to full. |
| falloffType | "linear" | "quadratic" | "cubic" | "square" | "linear" | Ramp curve. Linear is a smoothstep, square a square root. |
| originX / originY | number / number | 0 / 0.5 | Where the ramp starts, 0 to 1 from the left and bottom. |
| distortion / dispersion | number / number | 0.3 / 0.4 | Radial lens distortion (-1 to 1) and the red and blue split, which scales with blur. |
| noise / noiseBlend | number / "none" | "lighter" | "darker" | "both" | 1 / "darker" | Grain amount and the tones it shows in. |
| appear / duration / ease | boolean / number / [number, number, number, number] | true / 2 / [0.44, 0, 0.56, 1] | Pull from the blurred state into focus on mount. With appear off the media stays blurred. |
| className / style | string / CSSProperties | — | Root props. The component fills its parent. |
None.