A photograph as a paint-by-numbers canvas: the hand floods one numbered area at a time with wet acrylic that stops at the outline, and a click lets the kit finish itself.
Use it as the hero of a craft or print-on-demand page. Needs regions, lines and photo images (required) plus kit data derived offline from the same photograph; onProgress drives a palette and an optional intro paints the first areas.
When not to use
Too much for dense data screens, forms or long text, and not usable without the prepared region map and kit data. For a calm hero use a plain still photograph.
Use it as the hero of a craft or print-on-demand page; pass the region map, the printed plate and the kit data derived offline from your photograph, and drive a palette through onProgress. Effects are visual
pieces rather than controls: they do not replace the Interface components in dashboards and forms.
The effect needs your image through its image prop (see the table below). Use a JPEG or WebP of at
least 1600 px on the long side, under 200 KB (400 KB at full screen); host it on your own origin or
send CORS headers, because the browser blocks cross-origin textures. The demo images stay on this
site and are not installed.
The canvas is decorative and aria-hidden; describe the picture for assistive technology with a role=img element in the children, as in the demo.
The effect never takes focus. On touch screens an automatic brush paints across the canvas, the kit finishes itself and the paint lifts to start over; a finger takes the brush, a tap finishes or lifts the kit, the brush returns 1.5 s after release and vertical scrolling stays with the page.
The figure and the train already painted on a still frame, the sky and the sea still numbered; the pointer still paints, at once. The ByNumbers hooks read usePrefersReducedMotion, so the MotionKitProvider setting applies too.
Every numbered area lives in one float state texture sampled by a single fragment shader; frames are drawn only while something moves, and the loop stops off screen and in hidden tabs.
The device pixel ratio is capped at 2. Without WebGL support the content renders without the effect.
Source size is checked against the 15 KB gzip budget for effects (pnpm size).
Technical sheet
Motion
calm
260 ms · bounce 0
lively
400 ms · bounce 0.3
playful
540 ms · bounce 0.45
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Size
Not measured yet · budget 15.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom.
Dependencies
motion
ogl@1.0.11
Triggers
pointer movement, click
Reduced motion
The figure and the train already painted on a still frame, the sky and the sea still numbered; the pointer still paints, at once.
Keyboard
No keyboard interaction of its own.
Browsers
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)