# Panda

The bear that sits down to use its hands. The seat is a third contact with a span of its own — which is what buys back a base once both forepaws have left the floor — and the pseudo-thumb's pad gap is an output of whatever is between the pads rather than of the dial.

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

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

## Notes

- The seat is not a pose: the pelvis is rigid on the body, so where its underside ends up is a consequence of the tilt, and when it would go through the floor the animal rests on it. It then enters solveSupport as a third contact with a span of its own. Just before it lands, both forepaws are on the stalk and the two hind soles have rolled onto their heels — two points in the same place, which is not a base — so the seat is what is holding the animal up, and the blueprint variant draws it.
- The pad gap is an output: gap = 9 · (1 − grip), and a stalk wider than the gap rides the thumb further open at the same grip. Closing on nothing brings the pads together. The digits, the claws and the pelage are drawn; the thumb's angle and the forelimb chains are solved.
- The stalk is a real target: solveSole places each forepaw on it and the two links answer, so moving the stalk moves the whole chain. The two paws stack on it the way a pair of hands do.
- Illustrative kinematics with a static weight distribution on top — no dynamics, no grasp forces, no friction between pad and stalk, and the animal does not travel across its frame.

## Usage

```tsx
import { RobotPanda } from "@/components/ui/robot-panda"

<RobotPanda behavior="feed" />

// Or sit it down and hand it a stalk of your own size.
<RobotPanda sit={1} grip={1} stalkWidth={8} stalk={{ x: 30, y: 34 }} showSupport />
```

## 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` | `"feed" | "sit" | "amble" | "static"` | `"feed"` | What it does when nothing is driving it: sit and bring a stalk up to the muzzle, sit with both forelimbs free, the lateral-sequence plantigrade walk, or standing square. |
| `phase` | `number` | — | Controlled cycle fraction. Supplying it stops the internal clock. |
| `speed` | `number` | `0.35` | Feeding cycles, or strides, per second. |
| `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. |
| `sit` | `number` | — | 0 standing to 1 down on the seat. Omit and the behavior works it. |
| `grip` | `number` | — | How far the pseudo-thumb is closed on the digits, 0–1. |
| `stalkWidth` | `number` | `5` | Stalk diameter in world units, 0–9. What the thumb has to open around — the pad gap answers it. |
| `stalk` | `Vec2` | — | Where the stalk is, in the animal's own frame: x forward from the hip, y up off the floor. Both forepaws are solved to it. Omit and the pointer is the stalk. |
| `chew` | `number` | — | Jaw opening, 0 shut to 1 wide. Omit and the behavior chews. |
| `arch` | `number` | — | Back curvature, −1 hollowed to 1 roached. |
| `crouch` | `number` | — | Leg fold, 0 standing tall to 1 down on the hocks. |
| `gaze` | `number` | — | Eye aim, −1..1. The head tips toward the stalk on its own once it is near the muzzle. |
| `balance` | `number` | — | How much of the carriage the balance rule takes, 0 scripted to 1 derived. |
| `interactive` | `boolean` | `true` | The pointer is the stalk — both forepaws solve to wherever it is — and a click takes a bite. |
| `onStalkChange` | `(stalk: Vec2) => void` | — | Fired with the stalk position on a click. |
| `onBite` | `() => void` | — | Fired on the click that bites. |
| `showGround` | `boolean` | `true` | The ground line and the shadow. |
| `showContacts` | `boolean` | `false` | Mark each grounded sole, shaded by the share of the weight it carries. |
| `showSupport` | `boolean` | `false` | Draw the base of support and the centre of mass. This is the machine where you can watch the base being bought. |
| `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-panda.tsx`
