crucıble

Electrotype

Image or seeded procedural plate deposited as a hex grid of metal domes whose radius follows luminance: plates in along a noisy front, glints slide under a drifting key light, and the pointer acts as an electrode that swells nearby dots into a crust with a depleted ring around it. Stacking pulse clicks, multi-image dissolve-and-replate morphs, nickel/copper/gold or custom metal, light tone. Original OGL shader, DPR-clamped, offscreen-paused, reduced-motion static frame.

oglpro

Installation

CLI

npx shadcn@latest add @crucible/electrotype

Manual — install dependencies, then copy the source

npm install ogl

Props

PropTypeDefaultDescription
refReact.Ref<ElectrotypeHandle>React 19 ref-as-prop → {@link ElectrotypeHandle}.
srcstringA single image URL to plate (loaded with crossOrigin="anonymous", so cross-origin hosts must send CORS headers). Ignored when images is set. Omit both for three built-in seeded procedural plates.
imagesstring[]Several image URLs: every interval seconds (and on next()), the deposit dissolves along a noisy front and the next image plates back in.
dotnumber12Dot pitch — distance between neighbouring dot centers — in CSS px, 5–40.
metalElectrotypeMetal"nickel"Metal finish of the deposit. Ignored when colors is set.
colors[string, string, string]Custom metal ramp [shadow, body, highlight] (hex). Overrides metal — e.g. ["#101a2c", "#5d86c9", "#e6f0ff"] for anodised blue.
contrastnumber1.3Luminance contrast before it drives dot radius, 0.3–3.
intervalnumber9Seconds between automatic image changes (when there is more than one image), or 0 to disable. Pauses offscreen and under reduced motion.
tone"dark" | "light""dark""dark" — bright metal on near-black, dots grow with luminance; "light" — metal on pale stock, dots grow with darkness (reads like print).
interactivebooleantruePointer acts as an electrode: nearby dots swell into a crust with a depleted ring just outside; clicks stack plating pulses. When idle, a ghost electrode wanders so the surface never looks dead. Listens on the parent element, so overlay content above it does not block the effect.
pausedbooleanfalseFreeze all animation at the current frame.
Also accepts all props of Omit<React.ComponentPropsWithoutRef<"div">, "children"> — they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, pauses offscreen and on hidden tabs, and passes className through.