crucıble

Oxide

Image carousel that transitions through a spreading temper-color front: from the click point a noise-roughened edge creeps across the card like heat through steel, washing the outgoing picture in luminance-modulated straw, bronze, purple and blue oxide film before the next image cools in. Stacking clicks, autoplay, next/prev/goTo handle, scroll scrub, seeded procedural plates. Original OGL shader, DPR-clamped, offscreen-paused, reduced-motion crossfade.

oglpro

Installation

CLI

npx shadcn@latest add @crucible/oxide

Manual — install dependencies, then copy the source

npm install ogl

Props

PropTypeDefaultDescription
refReact.Ref<OxideHandle>React 19 ref-as-prop → {@link OxideHandle}.
imagesstring[]Image URLs to cycle through (loaded with crossOrigin="anonymous", so cross-origin hosts must send CORS headers). Cover-fit to the card. Omit for three built-in seeded procedural plates.
altsstring[]Accessible descriptions, one per image — announced on change.
indexnumberControlled current image index. Changing it tempers to that image.
defaultIndexnumber0Initial image index when uncontrolled.
onIndexChange(index: number) => voidFired whenever a transition toward a new image begins.
durationnumber1400Length of one temper transition, in milliseconds.
autoplaynumber | false4200Auto-advance interval in milliseconds (counted while idle and on-screen), or false to disable. Pauses offscreen, on hidden tabs, while keyboard focus is inside, and under reduced motion.
origin"pointer" | "center""pointer"Where each front starts: "pointer" — the click point (autoplay picks a seeded wandering point); "center" — always the card center.
bandWidthnumber0.24Width of the temper-color band, as a fraction of card height, 0.05–0.6.
noiseScalenumber2.4Scale of the fbm that roughens the front, 0.5–8. Higher = finer lobes.
palettestring[]is the metallurgical sequence straw → bronze → purple → blue → pale grey-blueOverride the temper stops (2–6 hex colors), ordered from the leading edge inward.
scrollProgressnumberControlled scrub, 0–1, across the whole image sequence (e.g. scroll progress). When set, clicks and autoplay are disabled and the front is driven directly by this value.
controlsbooleanfalseRender real prev/next buttons over the card.
seednumber7Seed for the front noise and the autoplay origins.
pausedbooleanfalseFreeze all animation at the current frame.
Also accepts all props of Omit<React.ComponentPropsWithoutRef<"div">, "onChange" | "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.