# Scorpion

An eight-legged stalker from above with a metasoma solved in the sagittal plane, so the solver's own x is how far back the tail reaches and its y is how high — the arch is a real height, not a shorter drawing.

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

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

## Notes

- The tail is one curve supplying two facts: where each segment sits in plan, and how high it is. Arch it and the plan footprint genuinely comes back over the body, because the tail really has curled forward.
- Off-axis the tail is projected at those heights, which is where the arch stops being an inference.
- The pedipalps are illustrated linkages with one solved degree of freedom apiece — the hinged jaw. The legs and the tail are the solved parts.

## Usage

```tsx
import { RobotScorpion } from "@/components/ui/robot-scorpion"

<RobotScorpion behavior="stalk" />

// Or drive the gait, the arch and the claws yourself.
<RobotScorpion phase={0.4} arch={1} claw={0.9} heading={-25} showContacts />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"plan"` | Where the camera stands. One animal, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `behavior` | `"stalk" | "guard" | "strike" | "static"` | `"stalk"` | What it does when phase is not supplied: low and forward, planted with the tail up, or loading and letting go. |
| `gait` | `string` | — | Footfall pattern: stand, tripod, wave or ripple. Omit and the behavior picks one. |
| `phase` | `number` | — | Controlled cycle fraction. Supplying it stops the internal clock. |
| `speed` | `number` | `0.9` | Gait cycles per second. |
| `offset` | `number` | `0` | Seconds of offset, so a nest 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. |
| `legs` | `number` | `8` | Walking legs, rounded to an even number and clamped to 4–10. The pedipalps are extra. |
| `height` | `number` | `0.5` | Normalized body clearance, clamped to 0–1. |
| `stride` | `number` | `0.66` | Normalized foot travel, clamped to 0–1. |
| `lift` | `number` | `0.5` | Normalized swing height, clamped to 0–1. |
| `heading` | `number` | — | Which way it faces, in degrees. Omit and it turns toward the pointer. |
| `arch` | `number` | — | Tail arch, 0 trailing flat to 1 curled over the back. Omit and the behavior sets it. |
| `claw` | `number` | — | Pedipalp opening, 0 shut to 1 spread. Omit and the behavior works them. |
| `segments` | `number` | `9` | Links in the tail, clamped to 3–24. |
| `interactive` | `boolean` | `true` | It turns toward the pointer, and a click whips the tail over. |
| `onStrike` | `() => void` | — | Fired on the click that strikes. |
| `showGround` | `boolean` | `true` | The ground patch under the machine. |
| `showContacts` | `boolean` | `false` | Ring the feet 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-scorpion.tsx`
