# Conveyor belt

A production-line conveyor with rollers and workpieces. Runs automatically or follows a controlled travel value, wrapping in either direction.

> For the complete index, see [llms.txt](https://robocn.dev/llms.txt). A Markdown version of any page is available by appending `.md` to its URL or by sending an `Accept: text/markdown` header.

## Install

```bash
bunx --bun shadcn@latest add https://robocn.dev/r/conveyor-belt.json
```

Registry item: `conveyor-belt` · [`https://robocn.dev/r/conveyor-belt.json`](https://robocn.dev/r/conveyor-belt.json)

## Notes

- Side elevation is the drawing it always had. A conveyor is a bed, so the width across the line, the rollers as cylinders and the side frames only appear once the camera comes round.
- A supplied position updates immediately and disables the internal animation loop. The travel slider in the demo shows this controlled mode.
- A scrubbed belt does not snap back to line speed on release: it eases up to it, on the same rate limiter every other machine in the set returns on.
- Omit position for automatic motion, or set animate={false} for a still illustration. The animation loop is cleaned up on unmount.

## Usage

```tsx
import { ConveyorBelt } from "@/components/ui/conveyor-belt"

<ConveyorBelt parts={4} direction="right" size="lg" />

// Controlled, or a jog wheel you can scrub.
<ConveyorBelt position={0.25} />
<ConveyorBelt interactive onPositionChange={setPosition} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"profile"` | Where the camera stands. One line, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `position` | `number` | — | Controlled belt travel in revolutions. Wraps at every integer. Omit to run automatically; non-finite values park at zero. |
| `parts` | `number` | `3` | Evenly spaced workpieces, rounded and clamped to 0–12. Zero gives an empty belt; non-finite values use three. |
| `direction` | `"left" | "right"` | `"right"` | Direction of travel, including controlled travel. |
| `speed` | `number` | `0.12` | Turns per second when uncontrolled. Zero or non-finite values park the belt; negative values reverse travel. |
| `animate` | `boolean` | `true` | Enables automatic travel. Reduced-motion preference also disables it. |
| `paused` | `boolean` | `false` | Freeze the belt where it stands. |
| `phase` | `number` | `0` | Turns of offset, so a bank of belts breaks step. |
| `interactive` | `boolean` | `false` | Drag the belt to scrub it — the part under your finger stays under it — and release to let the line pick back up. |
| `onPositionChange` | `(position: number) => void` | — | Belt travel in turns, throughout a drag or a key press. |
| `label` | `string` | — | Caption underneath the conveyor. |
| `variant` | `"solid" | "outline" | "blueprint" | "wire"` | `"solid"` | How the machine is painted. Geometry never changes between variants. |
| `size` | `"xs" | "sm" | "md" | "lg" | "xl" | number` | `"md"` | Rendered width in pixels, or a step on the scale. |
| `color` | `string` | `var(--robot-shell)` | Body panels — the colour the machine reads as. |
| `accent` | `string` | `var(--robot-accent)` | Status colour: tip light, live tool, readouts. |
| `metal` | `string` | `var(--robot-metal)` | Bare machined parts: collars, bolts, tool bodies. |
| `dark` | `string` | `var(--robot-dark)` | Cast joints, base, shadow side. |
| `palette` | `Partial<RobotPalette>` | — | Override any subset of roles at once, including glow and grid. |

## Source

- `src/components/ui/conveyor-belt.tsx`
