# Strike starfighter

A split-foil attack fighter: four wings on two fore-aft hinges that open from a cruise plane into an X, carrying their own engines and tip cannons with them.

> 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/strike-starfighter.json
```

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

## Notes

- One geometry, four panels, two hinges. Each pair swings about a fore-aft axis at its own root, and every panel keeps its span and its chord at every opening — the engines and the tip cannons are carried on the panels rather than drawn where they look right, so opening the foils genuinely spreads the guns and the thrust line.
- `bank` rolls the whole airframe about the same axis, which is why an opened X reads as an X from every camera: it is projected, not redrawn.
- A science-fiction archetype and nothing more: no character, no markings, no livery. Nothing here is aerodynamic — there is no air — and the fighter does not travel.

## Usage

```tsx
import { StrikeStarfighter } from "@/components/ui/strike-starfighter"

<StrikeStarfighter behavior="attack" />

// Front is where the X is; plan is the same hinge from above.
<StrikeStarfighter foils={1} view="front" />
<StrikeStarfighter foils={0} bank={35} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"front"` | Where the camera stands. One fighter, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `foils` | `number` | — | The S-foils, 0 closed (cruise) to 1 open (attack). Supplying it stops the loop. |
| `onFoilsChange` | `(foils: number) => void` | — | The commanded opening, while a person is working the foils. |
| `bank` | `number` | — | Roll about the fore-aft axis in degrees. Omit it and the behaviour flies it. |
| `behavior` | `"patrol" | "attack" | "static"` | `"patrol"` | Cruise with the foils closed and open them for a look, or hold them open and fly hard. |
| `speed` | `number` | `0.25` | Foil 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 up the frame to open the foils; arrow keys move them five percent at a time. |
| `showCannons` | `boolean` | `true` | Cannons on the four wing tips. They are carried on the panels, so opening the foils spreads them. |
| `active` | `boolean` | — | Light the engines, the canopy and the nose sensor. |
| `label` | `string` | — | Caption underneath the fighter. |
| `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/strike-starfighter.tsx`
