# Astromech droid

A barrel repair unit with tripod and bipod ride heights, a rotating dome and radar eye, an opening service panel, a rising periscope, and a holographic projection cone.

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

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

## Notes

- Front elevation is the drawing it always had. The barrel is a drum, the centre foot stands behind the other two rather than between them, and the dome sits on top of both — none of which is in a single view.
- Every value is controlled when you supply it and self-running when you do not; pointer tracking beats the behaviour while the pointer is over it.
- Ride height follows the chassis mode, so legMode changes the body transform as well as the feet.
- The periscope is dome-mounted and does not require the service panel to be open.

## Usage

```tsx
import { AstromechDroid } from "@/components/ui/astromech-droid"

<AstromechDroid legMode="tripod" domeAngle={55} panel tool="welder" holo={0.8} lean={-6} />
```

## 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. |
| `legMode` | `"tripod" | "bipod"` | `"tripod"` | Tripod drops the centre foot and squats; bipod retracts it and stands tall. |
| `dome` | `"round" | "flat" | "faceted"` | `"round"` | Upper sensor-shell silhouette, drawn into the same envelope. |
| `livery` | `"plain" | "banded" | "paneled"` | `"banded"` | How much panel detailing the body carries. |
| `feet` | `"skid" | "wheel" | "tread"` | `"skid"` | Contact hardware under every foot, centre leg included. |
| `antenna` | `"none" | "whip" | "dish"` | `"none"` | Communications hardware on the dome; it swings with the heading. |
| `ports` | `number` | `2` | Service hatches down the body front, clamped to 1–3. |
| `domeAngle` | `number` | — | Dome heading in degrees, wrapped to −180..180. Omit and the dome turns itself — to the pointer, or with the behaviour. |
| `lean` | `number` | — | Whole-body lean in degrees, clamped to −14..14. Omit and the behaviour rocks it. |
| `panel` | `boolean` | — | Open the front service panel. Omit and the work cycle opens and closes it. |
| `tool` | `"none" | "probe" | "welder" | "periscope"` | `"none"` | Instrument extended from the open panel; periscope rises from the dome instead. |
| `holo` | `number` | — | Projection strength 0–1; zero hides the cone entirely. Omit and the behaviour fades it up and down. |
| `behavior` | `"work" | "roam" | "idle" | "static"` | `"work"` | Work turns to the socket, opens up and projects; roam sweeps the dome and rocks on the tripod; idle drifts. |
| `speed` | `number` | `0.25` | Work 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. |
| `phase` | `number` | `0` | Seconds of offset, so a row of machines breaks step. |
| `interactive` | `boolean` | `true` | The dome turns to the pointer while it is over the drawing, and goes back to work when it leaves. |
| `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/astromech-droid.tsx`
