Dither Spotlight

Dither Spotlight

A WebGL cursor spotlight rendered as ordered halftone dots instead of a soft glow.

Installation

▸ Run the following command

npx shadcn@latest add https://www.mellowui.com/r/dither-spotlight.json

▸ Or install manually

  1. Copy the source from the Code tab above.
  2. Place it at components/mellow/dither-spotlight.tsx
  3. Import and use.

API Reference

PropTypeDefaultDescription
radiusnumber220Spotlight radius in pixels.
softnessnumber0.25How quickly the spotlight falls off near its edge.
dotScalenumber5Halftone dot cell size in pixels.
intensitynumber0.92Maximum strength of the printed spotlight.
followSpeednumber0.14Cursor smoothing speed; higher values follow faster.
classNamestringAdditional CSS classes.
childrenReact.ReactNodeContent rendered above the shader canvas.