# Foot

One ankle, one toe hinge, and the load moving between them: dorsiflexed at heel strike, flat at mid-stance, plantarflexed with the heel lifted at push-off.

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

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

## Notes

- The toe plate is hinged at the ball rather than welded to the sole, so plantarflexing over a planted foot extends that hinge and lifts the heel instead of driving the toe through the floor.
- The ankle strut's length is measured between the two points the pose produced, so its stroke is a consequence of the joint angle rather than an illustration of one.
- The loads are geometry — which parts of the sole are still down — and not forces. Nothing here weighs anything.

## Usage

```tsx
import { RobotFoot } from "@/components/ui/robot-foot"

<RobotFoot behavior="step" side="left" />

// Controlled, or a foot you can roll by hand.
<RobotFoot roll={0.85} view="iso" />
<RobotFoot interactive onRollChange={setRoll} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"profile"` | Where the camera stands. One foot, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `roll` | `number` | — | Controlled stance, 0 at heel strike to 1 at toe-off. Supplying it stops the loop and keeps the foot on the floor. |
| `behavior` | `"step" | "rock" | "static"` | `"step"` | Roll through a stance then lift and carry back, or rock heel to toe without ever leaving the floor. |
| `side` | `"left" | "right"` | `"right"` | A foot is handed; left is right mirrored across the machine's axis. |
| `speed` | `number` | `0.5` | Steps 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` | Drag left and right to roll the foot heel to toe. |
| `onRollChange` | `(roll: number) => void` | — | Stance fraction, 0–1, throughout a drag or a key press. |
| `showLoad` | `boolean` | `true` | Tint the heel, ball and toe pads by how much of each is still on the floor. |
| `showGround` | `boolean` | `true` | Draw the floor line the sole rolls on. |
| `label` | `string` | — | Caption below the stance readout. |
| `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-foot.tsx`
