# Molten — WebGL Background for React

> The signature pro background: a viscous molten-bronze shader with amber crest highlights, ember-red troughs, a slow violet iridescence sweep, and a cursor heat-welt that swells the metal. Original OGL fragment shader, offscreen-paused and reduced-motion-safe; a ghost pointer keeps it moving when untouched.

- Page: https://crucibleui.com/components/backgrounds/molten
- Category: [backgrounds](https://crucibleui.com/backgrounds)
- Tier: pro (one-time purchase, see https://crucibleui.com/pricing)
- Engine: ogl
- npm dependencies: ogl

## Install

```bash
npx shadcn@latest add @crucible/molten
```

Pro install requires adding the token-bearing `@crucible` registry to components.json (issued at https://crucibleui.com/account after purchase).

Import from `@/components/crucible/molten`.

Backgrounds render `absolute inset-0 -z-10`. Their parent must be a stacking context — wrap in `relative isolate` and put your content in a `relative z-10` child, or the background disappears behind an opaque ancestor.

## Props (`MoltenProps`)

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colors?` | `[string, string, string]` | `the Crucible forge palette` | Three forge tones: `[crest, trough, iridescence]`. Amber catches the wave crests, ember red pools in the troughs, violet slides across the slopes as tempering color. Any hex strings. |
| `speed?` | `number` | `1` | Flow speed multiplier. 1 = the default viscous crawl. |
| `heat?` | `number` | `0.6` | Heat, 0–1. Scales glow, saturation, and motion energy together: 0 is a cooling, near-set pour; 1 is white-hot and restless. |
| `amplitude?` | `number` | `1` | Wave relief multiplier — how sculpted the surface reads. |
| `scale?` | `number` | `1` | Wave frequency multiplier — higher packs more folds in. |
| `welt?` | `number` | `0.75` | Cursor heat-welt strength, 0–1. The surface swells and brightens under the pointer, like metal prodded while soft — a welt, not a ripple. 0 disables. |
| `idle?` | `boolean` | `true` | Idle autoplay: after ~1.5s with no real pointer, a seeded ghost pointer drags a softer heat-welt across the pour on a slow drift so it never looks dead in thumbnails and heroes; the real pointer takes over instantly. Never runs under reduced motion. |
| `paused?` | `boolean` | — | Freeze the animation, holding the current frame. |
| `onReady?` | `() => void` | — | Fired once the shader's first frame has rendered (for fade-in on load). |
| `className?` | `string` | — | Extra classes for the wrapper. Positioned `absolute inset-0 -z-10`. |

## Usage example

`DemoScene` is a site-only preview harness, not part of the component — replace it with your own layout.

```tsx
import { Molten } from "@/components/crucible/molten";
import { DemoScene } from "@/components/registry/demo-scene";

export default function MoltenDemo() {
  return (
    <DemoScene
      background={<Molten />}
      headline="Depth without the noise"
      subhead="A liquid surface in slow undulation — move your cursor to press in."
    />
  );
}
```

## Accessibility & performance

Honors `prefers-reduced-motion` with a designed static frame or fade (never a blank box) and passes `className` through. Pauses offscreen and on hidden tabs, clamps device pixel ratio, and tears down its GL/canvas context on unmount.
