# Gripper

A standalone end effector with parallel or angular fingers. Drive the jaws from application state to build a fixture, tool selector, or work-cell simulation.

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

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

## Notes

- Front elevation is the drawing it always had. The body, the wrist block and the jaw plates gain their depth through the tool as the camera comes round.
- A supplied opening always wins and stops the loop. Uncontrolled, the jaws work a pick cycle, parked by a reduced-motion preference.
- The drawing exposes an accessible name with its opening percentage. Override aria-label for application-specific context.

## Usage

```tsx
import { RobotGripper } from "@/components/ui/robot-gripper"

<RobotGripper fingers="parallel" active size="lg" />

// Controlled, or a control: drag a jaw, or click to toggle.
<RobotGripper opening={0.65} />
<RobotGripper interactive onOpeningChange={setOpening} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"front"` | Where the camera stands. One tool, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `opening` | `number` | — | Controlled jaw opening, clamped to 0–1. Omit it and the jaws run behavior. |
| `behavior` | `"cycle" | "flex" | "static"` | `"cycle"` | A pick cycle — open, close onto a part, carry it, release — or a shallow breathing open and shut. |
| `speed` | `number` | `0.3` | Pick cycles 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 a jaw to set the opening, click to toggle open and shut, or arrow-key it. |
| `onOpeningChange` | `(opening: number) => void` | — | Fired throughout a drag, a tap or a key press. |
| `fingers` | `"parallel" | "angular"` | `"parallel"` | Straight fingers or inward-reaching angled fingers. Both close at the centre. |
| `active` | `boolean` | `false` | Pulses the status lamp, respecting reduced motion. |
| `holding` | `boolean` | — | Draws a workpiece between the jaws. Omit it and the pick cycle carries one: the part appears when the jaws close on it. |
| `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-gripper.tsx`
