# Bird

A perching flyer in profile. Each wing is a three-link chain carrying fanned feather plates, so folding, extending and beating are one mechanism.

> 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-bird.json
```

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

## Notes

- Side elevation is the drawing it always had. The wings are either side of the torso rather than one behind the other, which only reads once the camera comes round.
- Folding and beating are the same chain at different angles, so a wing never has two sets of artwork: spread interpolates the whole linkage between tucked and extended.
- The wing is an illustrated linkage driven by angles rather than an inverse-kinematic solve — there is no target for it to reach. The feather fan opens on the downstroke and closes coming up, which is what a real primary fan does.

## Usage

```tsx
import { RobotBird } from "@/components/ui/robot-bird"

<RobotBird behavior="perch" />

// Or drive the beat and the pose yourself.
<RobotBird phase={0.25} spread={1} tail={0.8} altitude={0.6} headAngle={-20} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"profile"` | Where the camera stands. One bird, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `behavior` | `"perch" | "flap" | "glide" | "static"` | `"perch"` | What it does when phase is not supplied: sits folded and looks around, beats, or holds the wings out and trims with the tail. |
| `phase` | `number` | — | Controlled wingbeat fraction. Supplying it stops the internal clock. Wraps in both directions. |
| `speed` | `number` | `1.6` | Wingbeats per second. |
| `offset` | `number` | `0` | Seconds of offset, so a flock breaks step. |
| `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. |
| `spread` | `number` | — | Wing extension, 0 folded against the body to 1 spread. Omit and the behavior sets it. |
| `tail` | `number` | — | Tail fan, 0 closed to 1 spread. Omit and the behavior sets it. |
| `altitude` | `number` | — | Height above the perch, 0–1. Above zero the legs tuck. Omit and the behavior decides. |
| `headAngle` | `number` | — | Head turn in degrees, clamped to −40..40. Omit and it follows the pointer. |
| `interactive` | `boolean` | `true` | The head tracks the pointer, and a click launches it: wings out, hard beats, then a settle back onto the perch. |
| `onTakeoff` | `() => void` | — | Fired on the click that starts a launch. |
| `showGround` | `boolean` | `true` | The perch and its shadow. |
| `label` | `string` | — | Caption underneath the bird. |
| `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-bird.tsx`
