# Gantry

A cartesian gantry. The axes are independent, so the head takes the dog-leg path a real machine takes rather than an arc.

> 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/gantry-arm.json
```

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

## Usage

```tsx
<GantryArm behavior="sweep" trail tool="painter" />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"front"` | Where the camera stands. One machine, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `target` | `Vec2 | ((clock: number) => Vec2) | null` | — | Head position. x runs ±52, y from the bed up to about 76. |
| `behavior` | `"pointer" | "orbit" | "sweep" | "idle" | "static"` | `"sweep"` | Sweep rasters the long axis and steps the short one. |
| `trail` | `boolean` | `false` | Draw where the head has been — turns the gantry into a plotter. |
| `trailLength` | `number` | `90` | How many trail points to keep. |
| `showBed / showRulers` | `boolean` | — | The bed, and the dimension lines. Rulers default on in blueprint. |
| `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. |
| `thickness` | `number` | `1` | Limb weight multiplier, independent of size. |
| `speed` | `number` | — | Tip travel in world units per second. |
| `animate` | `boolean` | `true` | Off snaps to a fixed goal or samples a scripted path at phase, then stops. Reduced-motion preference does the same. |
| `paused` | `boolean` | `false` | Freeze in place. |
| `phase` | `number` | `0` | Seconds of offset, so a row of machines breaks step. |
| `interactive` | `boolean` | `false` | Press and drag inside the frame to send the tool there; release and it eases back into its behaviour. Hover is not available on a touch screen, so this is how one drives it. |
| `onTargetChange` | `(target: Vec2 | null) => void` | — | The dragged goal in world units, and null on release. |
| `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/gantry-arm.tsx`
