# Receiver

The route tree as geometry: the runner is a point at an arc length along a polyline, and the lean into a cut is the exterior angle at the break.

> 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/gridiron-receiver.json
```

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

## Notes

- Nobody typed a lean. sampleRoute returns the turn being taken at the nearest corner, faded in over a couple of yards either side of it, and that number is the bank, the shoulder twist and the head turn.
- The gait phase comes off the distance run rather than a second clock, so the stride cannot drift away from the ground the machine is covering.
- Two scales on purpose: the machine at machine scale and the route beside it at field scale, because a twelve-yard route is six machine-heights long and one scale would lose one of them.
- No defenders, no coverage, no separation. The ball only appears when catch puts one in the hands.

## Usage

```tsx
import { GridironReceiver } from "@/components/ui/gridiron-receiver"

<GridironReceiver route="post" depth={12} behavior="route" />

// Controlled: put it anywhere along the route, in yards.
<GridironReceiver route="corner" side={-1} distance={13.4} />
<GridironReceiver behavior="catch" number="88" />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"profile"` | Where the camera stands. One machine, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `route` | `"go" | "hitch" | "slant" | "flat" | "out" | "in" | "curl" | "comeback" | "post" | "corner" | "wheel"` | `"post"` | Which route. Outside breaks are positive x and inside breaks negative, so the whole tree mirrors on one sign. |
| `depth` | `number` | `12` | How deep the break is, in yards. |
| `side` | `number` | `1` | 1 aligned right; -1 mirrors the whole route. |
| `distance` | `number` | — | Controlled yards run along the route. Supplying it stops the loop. |
| `behavior` | `"route" | "release" | "catch" | "idle" | "static"` | `"route"` | What it does when distance is not supplied. Release is the first couple of yards worked back and forth. |
| `mask` | `"cage" | "bar" | "shield"` | `"cage"` | Facemask style. |
| `number` | `string` | `""` | Two characters on the chest plate. |
| `showRoute` | `boolean` | `true` | Draw the route map beside the machine. It is a map at field scale, and the panel says so. |
| `speed` | `number` | `0.28` | Cycles per second. |
| `animate` | `boolean` | `true` | Off parks the machine at phase and stops rendering. A reduced-motion preference does the same. |
| `paused` | `boolean` | `false` | Freeze where it stands. |
| `offset` | `number` | `0` | Seconds of offset. |
| `interactive` | `boolean` | `false` | Drag across to run the route by hand. |
| `onDistanceChange` | `(yards: number) => void` | — | Yards along the route, throughout a drag or a key press. |
| `showGround` | `boolean` | `true` | Draw the contact shadow, which fades in the flight phase of a run. |
| `label` | `string` | — | Caption below the readout. |
| `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/gridiron-receiver.tsx`
