# Infantry droid

A mechanical field unit with skeletal and armored frames, four controlled poses, and non-projectile utility equipment.

> 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/infantry-droid.json
```

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

## Notes

- Front elevation is the drawing it always had. A humanoid drawn from the front says nothing about its own depth: off that axis the torso, pelvis and head are boxes and the limbs are tubes set through the body, at the same joint angles the pose already solved.
- Equipment deliberately stays at utility pack, survey scanner, and protective shield silhouettes.
- Light and heavy frames share the same pose contract for easy replacement.

## Usage

```tsx
import { InfantryDroid } from "@/components/ui/infantry-droid"

<InfantryDroid frame="heavy" pose="guard" equipment="shield" signal="warning" />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"front"` | Where the camera stands. One droid, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `frame` | `"light" | "heavy"` | `"light"` | Skeletal scout or armored field silhouette. |
| `pose` | `"stand" | "march" | "guard" | "disabled"` | `"stand"` | Controlled whole-body posture. |
| `equipment` | `"none" | "pack" | "scanner" | "shield"` | `"none"` | Visible utility module carried by the frame. |
| `headAngle` | `number` | `0` | Head rotation in degrees, clamped to −75..75. |
| `behavior` | `"patrol" | "alert" | "idle" | "static"` | `"patrol"` | Patrol marches and looks left and right; alert stands to guard and scans in short turns; idle stands easy. |
| `speed` | `number` | `0.2` | Sweeps 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. |
| `phase` | `number` | `0` | Seconds of offset, so a row of machines breaks step. |
| `interactive` | `boolean` | `true` | The head follows the pointer, and a click puts the frame on guard — or stands it down again. |
| `onPoseChange` | `(pose: InfantryDroidPose) => void` | — | The stance a click asked for. |
| `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. |
| `showGround` | `boolean` | `true` | Draw the contact line or shadow beneath the droid. |
| `signal` | `"idle" | "ready" | "warning"` | — | Status-lamp state using neutral, accent, or shell colour; each component documents its visual default in the demo. |
| `label` | `string` | — | Optional technical caption under the drawing. |
| `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/infantry-droid.tsx`
