# Dog

The cat's spine carries both leg roots; this one's carries only the hip. A dog has no clavicle, so the shoulder is the far end of a scapula that swings on the ribcage — and the tail is solved across the centre plane, so the wag runs out of the drawing it is drawn in.

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

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

## Notes

- The hip is the last joint of the solved back; the shoulder is not on the spine at all. It is the far end of a scapula that pivots on the ribcage and swings with its own leg's stride, which is where a trot's reach comes from. The swing angle is a rule, the way the hock's is — humerus and radius are solved from the shoulder it puts there.
- The tail is solveSpine in the transverse plane, so the wag is perpendicular to the side elevation. The whole solved curve is then rotated bodily about the animal's lateral axis by the carriage, which preserves every link length exactly. In profile it foreshortens as it swings, because that is what a wagging tail does; plan and isometric show the arc whole.
- The neck is a solved two-link chain from the withers to the poll, so nose puts the head down without moving the withers. The head's own pitch at the poll is a rule off nose rather than the last link's direction, because a dog carries its head at an angle to its neck. The ears, the jaw and the tail's plates are drawn, not solved. Illustrative trajectories throughout: no balance, no ground reaction, no impulse in the bounce, and the animal never travels across the frame.

## Usage

```tsx
import { RobotDog } from "@/components/ui/robot-dog"

<RobotDog behavior="trot" />

// Or pose the back, the legs, the head and the tail yourself.
<RobotDog arch={0} crouch={0.2} nose={1} tail={0.2} wag={-0.8} ears={0.4} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"profile"` | Where the camera stands. One animal, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `behavior` | `"trot" | "sniff" | "sit" | "alert" | "static"` | `"trot"` | What it does when phase is not supplied: trot on diagonal pairs, quarter the ground nose-down, sit on its croup, or stand on point with a forefoot up. |
| `phase` | `number` | — | Controlled cycle fraction. Supplying it stops the internal clock. |
| `speed` | `number` | `0.7` | Cycles per second: one stride per cycle at a trot. |
| `offset` | `number` | `0` | Seconds of offset, so a pair of them 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. |
| `arch` | `number` | — | Back curvature, −1 hollowed into the play bow to 1 roached. Omit and the behavior sets it. Half the cat's range, because a dog holds a topline. |
| `crouch` | `number` | — | Leg fold, 0 standing tall to 1 flattened. Omit and the behavior decides. |
| `tail` | `number` | — | Tail carriage, −1 tucked under to 1 straight up. It is a rigid rotation of the whole solved tail about the animal's lateral axis. |
| `wag` | `number` | — | Where the tail is in its swing, −1 to 1 across the centre plane. Omit and it wags, harder while the pointer is on it. |
| `nose` | `number` | — | How low the head is carried, 0 up and level to 1 nose on the floor. It is the solved neck's target, not a rotation. |
| `ears` | `number` | — | Ears, −1 folded back to 1 pricked forward. Omit and they prick at the pointer. |
| `gaze` | `number` | — | Head and eye aim, −1..1. Omit and it follows the pointer. |
| `interactive` | `boolean` | `true` | The head, ears and eyes track the pointer, the wag picks up, and a click barks. |
| `onBark` | `() => void` | — | Fired on the click that barks. |
| `showGround` | `boolean` | `true` | The ground line and the shadow, which shrinks as the suspension lifts it. |
| `showContacts` | `boolean` | `false` | Mark the paws carrying weight. |
| `label` | `string` | — | Caption underneath the animal. |
| `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-dog.tsx`
