# Cinderfall — Cursor Effect for React

> A cursor spark trail: stardust sheds off the pointer white, falls under gravity while dimming through silver to a transparent fade, and fast strokes throw proportionally more — with the occasional heavy spark that bounces once on an invisible floor. Scoped to its container by default, idles on its own when untouched, and turns off under reduced motion.

- Page: https://crucibleui.com/components/cursors/cinderfall
- Category: [cursors](https://crucibleui.com/components/cursors)
- Tier: pro (one-time purchase, see https://crucibleui.com/pricing)
- Engine: canvas

## Install

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

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

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

## Props (`CinderfallProps`)

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className?` | `string` | — | — |
| `spawnThreshold?` | `number` | `12` | Minimum px the pointer must travel before a new spark sheds — the spawn-distance gate that keeps slow, tiny movements from spamming the trail. Faster strokes cross the gate more often and shed proportionally more sparks. |
| `lifetime?` | `number` | `1.1` | Mean spark lifetime in seconds (per-spark jittered ±35%). |
| `rate?` | `number` | `1` | Sparks shed each time the pointer crosses the spawn gate. |
| `gravity?` | `number` | `950` | Downward acceleration in px/s². |
| `colors?` | `[string, string, string, string]` | `a white → silver stardust ramp; pass warm stops for an ember-style trail` | Fade ramp `[fresh, bright, dim, faded]` — sparks spawn at the first stop and dim through the ramp as they fall while their alpha fades out. |
| `heavyChance?` | `number` | `0.09` | Chance a spark is a "heavy" ember that bounces once on an invisible floor. |
| `heat?` | `number` | `1` | 0–1 master energy: spark size, glow, shed rate. |
| `global?` | `boolean` | — | Attach to the whole viewport instead of the nearest containing element. Off by default — Cinderfall is scoped to its parent (place it inside a `relative` container) so it never sheds sparks page-wide unless you explicitly opt in. |
| `paused?` | `boolean` | — | Stop shedding and freeze sparks mid-air. |
| `maxParticles?` | `number` | `160` | Hard cap on live sparks; oldest are recycled beyond it. |
| `idle?` | `boolean` | `true` | Idle autoplay (scoped mode only): after 1.5s with no pointer in the container, a ghost stroke wanders a seeded Lissajous path — surging and easing so the shed rate breathes — and keeps the stardust falling. A real pointer takes over instantly. Also runs on touch-only devices. Never under reduced motion; sleeps offscreen and when `paused`. |

## Usage example

```tsx
import { Cinderfall } from "@/components/crucible/cinderfall";

export default function CinderfallDemo() {
  return (
    <div className="relative isolate flex h-full min-h-[360px] w-full items-center justify-center overflow-hidden rounded-xl bg-neutral-950">
      <div
        aria-hidden
        className="pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_at_center,rgba(255,255,255,0.035),transparent_70%)]"
      />
      {/* Scoped to this stage — sparks only shed inside the panel. */}
      <Cinderfall />
      <div className="relative z-10 px-6 text-center">
        <p className="text-3xl font-semibold tracking-tight text-white">Move your cursor</p>
        <p className="mx-auto mt-2 max-w-sm text-sm text-neutral-500">
          Drag across the panel — fast strokes shed the most sparks.
        </p>
      </div>
    </div>
  );
}
```

## 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.
