# Hydrofoil craft

A foilborne ferry — the one machine here that climbs out of its own ground plane. Lift goes as the square of speed, so the surface-piercing V sheds immersed area and the hull rises clear.

> 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/hydrofoil-craft.json
```

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

## Notes

- Solved: the rise, from `foilRise()`. A surface-piercing foil carrying a steady weight has to shed immersed area as 1/v², and the only way it can is by climbing until less of the V is wetted — so the accent on each limb is genuinely the part still below the waterline after the boat has risen.
- Below the takeoff speed the foil cannot carry her at all: she stays hullborne and rides the swell, and the ride goes quiet as she comes up, which is what a hydrofoil is for.
- Illustrated: the swell is a stated shape and the bow's lift through the transition is a rule. No drag, no wave-making, no cavitation, no righting moment, and she does not travel.

## Usage

```tsx
import { HydrofoilCraft } from "@/components/ui/hydrofoil-craft"

<HydrofoilCraft behavior="takeoff" />

// Below takeoff she is hullborne and rides the swell.
<HydrofoilCraft knots={12} />
<HydrofoilCraft knots={44} view="front" />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"profile"` | Where the camera stands. One craft, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `knots` | `number` | — | Speed through the water, 0–60. Supplying it stops the loop. |
| `onKnotsChange` | `(knots: number) => void` | — | The commanded speed, while a person is at the throttle. |
| `takeoffSpeed` | `number` | `18` | The speed the foils can first carry the boat at. Below it she stays hullborne however hard she is driven. |
| `behavior` | `"takeoff" | "foilborne" | "moor" | "static"` | `"takeoff"` | Work up through the transition and back down, hold her up, or lie alongside. |
| `speed` | `number` | `0.22` | Throttle 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` | `false` | Press and drag across her to set the speed; arrow keys move it two knots at a time, Home stops, End is full ahead. |
| `showSea` | `boolean` | `true` | The sea, the waterline, and the hull's shadow in it. |
| `active` | `boolean` | — | Spray off the struts. Omit and it appears whenever they are cutting water. |
| `label` | `string` | — | Caption underneath the craft. |
| `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/hydrofoil-craft.tsx`
