# Medical droid

A clinical service robot with a diagnostic meter and independently selected scanner, injector, clamp, or probe instruments.

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

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

## Notes

- Front elevation is the drawing it always had. The column is a tapered body of revolution rather than a flat panel, and the two instrument arms reach forward out of it — neither of which one elevation could say.
- Tools change the visible end geometry but do not imply medical advice or simulated treatment.
- The diagnostic value is a display input supplied by the parent application.

## Usage

```tsx
import { MedicalDroid } from "@/components/ui/medical-droid"

<MedicalDroid leftTool="scanner" rightTool="injector" diagnostic={0.82} signal="ready" />
```

## 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. |
| `leftTool / rightTool` | `"none" | "scanner" | "injector" | "clamp" | "probe"` | `"scanner" / "probe"` | Instrument mounted on each modular arm. |
| `diagnostic` | `number` | `0.65` | Normalized 0–1 diagnostic meter fill. |
| `headAngle` | `number` | `0` | Head rotation in degrees, clamped to −60..60. |
| `behavior` | `"diagnose" | "monitor" | "idle" | "static"` | `"diagnose"` | Diagnose ramps the readout to a result and holds it; monitor cycles a live trace; idle waits. |
| `speed` | `number` | `0.25` | Scans 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 runs the scan again from the top. |
| `onDiagnosticRestart` | `() => void` | — | Fired when a click restarts the scan. |
| `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/medical-droid.tsx`
