# Drone

A multirotor aircraft with four or six motors, counter-rotating propellers, landing gear and removable guards, drawn from any of four camera 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-drone.json
```

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

## Notes

- Every view draws the same model. Parts are defined in world units and pushed through the shared camera, so heading, guards and blade angle stay truthful from any angle; plan view is the identity projection. Landing gear and the fuselage sides only appear once the camera tips over.
- Non-finite angles use zero. The component illustrates flight; it does not calculate lift.

## Usage

```tsx
import { RobotDrone } from "@/components/ui/robot-drone"

<RobotDrone view="iso" rotors={6} behavior="orbit" />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `rotors` | `4 | 6` | `4` | Quadcopter or hexacopter geometry. |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"plan"` | Where the camera stands. One airframe, four projections: straight down, nose-on, side elevation, or three-quarter. |
| `behavior` | `"hover" | "orbit" | "pointer" | "static"` | `"hover"` | What it flies when nothing drives it: drift on the spot, a banked circle, or chase the cursor. |
| `heading` | `number` | — | Clockwise degrees from the nose-up position. Omit and the nose follows the flight path. |
| `rotorAngle` | `number` | — | Controlled blade angle in degrees. Omit and the rotors spin; adjacent propellers turn opposite ways. |
| `speed` | `number` | `0.2` | Orbits, or drift 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. |
| `onHeadingChange` | `(heading: number) => void` | — | The commanded bearing, wrapped to 0–360, while a person is flying it. |
| `guards` | `boolean` | `true` | Protective rings and struts around each rotor. |
| `interactive` | `boolean` | `false` | Press and drag to fly the aircraft; arrow keys nudge it, Escape releases it. |
| `active` | `boolean` | — | Illuminate the fuselage lamp. Omit and it lights while airborne. |
| `label` | `string` | — | Caption underneath the aircraft, independent of heading. |
| `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/robot-drone.tsx`
