# Arm

The articulated arm: any number of links, eight end effectors, four paint variants, four mounts. Give it a target, a behaviour, or a set of joint angles.

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

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

## Usage

```tsx
import { RobotArm } from "@/components/ui/robot-arm"

export function Cell() {
  return (
    <RobotArm
      links={[1, 0.82, 0.34]}
      tool="welder"
      behavior="pointer"
      size="lg"
      showEnvelope
    />
  )
}
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"profile"` | Where the camera stands. One arm, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `links` | `number[]` | `[1, 0.82, 0.34]` | Relative link lengths, shoulder outward. Scaled to fill reach, so these are proportions. |
| `reach` | `number` | `64` | Total stretch in world units. The view is 132 × 118 with the base at (0, 0). |
| `target` | `Vec2 | ((clock: number) => Vec2) | null` | `null` | Where the tool tip should be. A function of elapsed seconds scripts a path. |
| `angles` | `number[]` | — | Drive it forward instead: one degree value per joint. Overrides target and behavior. |
| `behavior` | `"pointer" | "orbit" | "sweep" | "idle" | "static"` | `"idle"` | What moves the tip when no target is given. |
| `bend` | `"up" | "down"` | `"up"` | Which way the elbow breaks. |
| `tool` | `"gripper" | "welder" | "painter" | "cutter" | "scanner" | "vacuum" | "magnet" | "none"` | `"gripper"` | End effector. |
| `grip` | `number` | — | Jaw opening, 0 closed to 1 wide. Defaults to reacting to `active`. |
| `active` | `boolean` | — | Tool running — sparks, spray, a spinning blade. Defaults to whether the tip is moving. |
| `mount` | `"floor" | "ceiling" | "wall-left" | "wall-right"` | `"floor"` | Where the machine is bolted down. |
| `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. |
| `label` | `string` | — | Stencilled onto the base plate. |
| `showEnvelope` | `boolean` | `false` | Dashed arcs for the inner and outer limits of the workspace. |
| `showAngles` | `boolean` | — | Joint readouts. On by default in the blueprint variant. |
| `showBase / showCable / showGrid` | `boolean` | — | Turn individual parts of the drawing off. |
| `onPose` | `(pose: RobotArmPose) => void` | — | Every solved pose: joints, tip, angles, and whether it is moving. |
| `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/robot-arm.tsx`
