# Rolling Mill — Scroll Animation for React

> A scroll-scrubbed container rotator with a beveled slab face: a gunmetal plate starts tilted back in 3D perspective and rotates flat while scaling up as it scrolls through the viewport, header text traveling in coordinated motion, cool white edge-light glowing at max tilt and dimming upright, and a neutral reflection band sliding down the plate face with the angle.

- Page: https://crucibleui.com/components/scroll/rolling-mill
- Category: [scroll](https://crucibleui.com/components/scroll)
- Tier: pro (one-time purchase, see https://crucibleui.com/pricing)
- Engine: motion
- npm dependencies: motion

## Install

```bash
npx shadcn@latest add @crucible/rolling-mill
```

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

Import from `@/components/crucible/rolling-mill`.

## Props (`RollingMillProps`)

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `title?` | `React.ReactNode` | — | Header content that travels in coordinated motion above the plate. |
| `children?` | `React.ReactNode` | `a stat sheet` | Content rendered on the plate face. |
| `tilt?` | `number` | `24` | Backward tilt in degrees at the start of the scroll. |
| `scale?` | `[number, number]` | `[0.94, 1.05]` | `[from, to]` scale of the plate across the scroll. |
| `scrollContainer?` | `React.RefObject<HTMLElement \| null>` | — | Scroll container to track instead of the window. Pass a ref to an internal `overflow-y-auto` element (this component's own demo does). |
| `heat?` | `number` | `0.85` | 0–1: strength of the edge-light and the reflection band. |
| `colors?` | `[string, string]` | — | `[edgeLight, sheen]` — the bright edge color and the counter-sheen it dims toward. |

Also accepts: `Omit<React.ComponentPropsWithoutRef<"section">, "title">`.

## Usage example

```tsx
"use client";

import * as React from "react";

import { RollingMill } from "@/components/crucible/rolling-mill";

export default function RollingMillDemo() {
  const scrollRef = React.useRef<HTMLDivElement>(null);

  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 ref={scrollRef} className="relative z-10 h-[360px] w-full overflow-y-auto">
        {/* Short intro so the tilted plate already peeks above the fold at rest —
            an empty first frame reads as a broken preview. */}
        <div className="flex h-28 items-center justify-center px-6 text-center">
          <p className="max-w-sm text-sm text-neutral-500">
            Scroll down — the plate starts tilted back and stands upright as it reaches center.
          </p>
        </div>
        <RollingMill
          scrollContainer={scrollRef}
          className="px-6 pb-10"
          title={
            <>
              <p className="text-3xl font-semibold tracking-tight text-white">
                Scroll to stand it up
              </p>
              <p className="mt-2 text-sm text-white/60">
                The edge-light fades as the plate levels out.
              </p>
            </>
          }
        />
        <div className="flex h-72 items-center justify-center px-6 text-center">
          <p className="max-w-xs text-sm text-neutral-500">
            Scroll back up — the plate leans away again, edge-light returning.
          </p>
        </div>
      </div>
    </div>
  );
}
```

## Accessibility & performance

Honors `prefers-reduced-motion` with a designed static frame or fade (never a blank box) and passes `className` through.
