# Wellhead tree

The valve stack on a completed well. Every valve's rising stem shows its state, and the accent is drawn only along the bore the open valves actually leave through.

> 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/wellhead-tree.json
```

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

## Notes

- The valve line-up is the mechanism: shut the master and nothing above it is live, whatever the choke is doing.
- No pressure, flow, temperature or rate is computed anywhere. `pressure` is a reading the caller supplies and the component only points a needle at.

## Usage

```tsx
import { WellheadTree } from "@/components/ui/wellhead-tree"

<WellheadTree service="production" behavior="throttle" />
<WellheadTree service="shut-in" choke={0} pressure={0.4} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `choke` | `number` | — | Controlled choke opening, 0 shut to 1 wide. Supplying it stops the loop. |
| `service` | `"production" | "shut-in" | "kill"` | `"production"` | What the tree is lined up to do, which is which valves are open. |
| `behavior` | `"throttle" | "shut-in" | "static"` | `"throttle"` | Working the bean across its range, or closing it and leaving it closed. |
| `pressure` | `number` | `0.58` | A gauge reading you supply, 0 to 1 of the dial. Never inferred. |
| `showFlow` | `boolean` | `true` | The line leaving the live wing, its width set by the choke. |
| `interactive / onChokeChange` | `boolean / (choke: number) => void` | — | Drag or arrow-key the choke open and shut. |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"front"` | Where the camera stands. One wellhead tree, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `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. |
| `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/wellhead-tree.tsx`
