# Launch vehicle

A two-stage orbital booster: it flies a pitch program, gimbals against it, throws half of itself away, and reports the ideal Δv left from the rocket equation.

> 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/launch-vehicle.json
```

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

## Notes

- Solved: the remaining Δv, from `tsiolkovsky()` summed over the stages still attached — so the number drops the moment the booster lets go, which is the only honest way to draw staging. The stage figures are stated, not a real vehicle.
- The engines gimbal against the program rather than being animated: they carry the pitch the stack has not taken up, so they centre once it is tracking and swing hardest through the pitchover.
- Illustrated: the pitch program is a curve chosen to look like a gravity turn, not a solved trajectory. There is no thrust, drag, mass flow, gravity loss or atmosphere, and no altitude is computed — the drawing is in the vehicle's own frame, and the pad is what falls away.

## Usage

```tsx
import { LaunchVehicle } from "@/components/ui/launch-vehicle"

<LaunchVehicle behavior="ascent" />

// One number is the whole flight.
<LaunchVehicle ascent={0.62} />
<LaunchVehicle ascent={0} showReadout={false} engines={5} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"front"` | Where the camera stands. One vehicle, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `ascent` | `number` | — | Where the vehicle is in its ascent, 0 on the pad to 1 at insertion. Supplying it stops the loop. |
| `onAscentChange` | `(ascent: number) => void` | — | The commanded point in the ascent, while a person is scrubbing it. |
| `behavior` | `"ascent" | "hold" | "static"` | `"ascent"` | Fly the ascent, or sit on the pad. |
| `engines` | `5 | 9` | `9` | Engines in the first-stage cluster. They all gimbal together. |
| `speed` | `number` | `0.16` | Flights per second, at the outside. |
| `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` | `false` | Press and drag up the frame to scrub the ascent; arrow keys move it four percent at a time, Home is the pad and End is insertion. |
| `showPad` | `boolean` | `true` | The pad and its hold-downs, which fall away as she climbs. |
| `showReadout` | `boolean` | `true` | Pitch, the stage that is burning, and the ideal Δv still attached. |
| `label` | `string` | — | Caption underneath the vehicle. |
| `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/launch-vehicle.tsx`
