# Suction gripper

A bar of bellows cups and the sheet it picks. The head stops where the part is and everything past contact goes into the bellows instead of the stroke.

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

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

## Notes

- robot-gripper's opposite number: no fingers, no pivot, nothing that closes. The axis is one descent, and past contact the head stops and the bellows take up the rest — which is why a cup bar can land on a part whose height it does not know.
- A held sheet rides the lips, so the vacuum is visible in where the part is rather than in a lamp. The line state is an input, not something inferred from the pose: vacuum says whether it is live and holding overrides the seal outright.
- No flow, no leak-down, no payload check. Nothing here says whether the part is heavy enough to fall off.

## Usage

```tsx
import { SuctionGripper } from "@/components/ui/suction-gripper"

<SuctionGripper cups={5} vacuum />

// Controlled, or a bar you can press down.
<SuctionGripper descent={0.9} holding />
<SuctionGripper interactive onDescentChange={setDescent} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"front"` | Where the camera stands. One head, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `descent` | `number` | — | Controlled descent, 0 raised to 1 pressed. Omit it and the head runs behavior. |
| `behavior` | `"cycle" | "breathe" | "static"` | `"cycle"` | Work a pick — down, seal, lift, place, release — or breathe about the middle of the stroke. |
| `speed` | `number` | `0.3` | Pick cycles per second, or breaths 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 the bar down onto the sheet, or arrow-key it five percent at a time. |
| `onDescentChange` | `(descent: number) => void` | — | Descent, 0–1, throughout a drag or a key press. |
| `vacuum` | `boolean` | `true` | Is the line live at all. With it off the cups never take the sheet. |
| `holding` | `boolean` | — | Override whether the sheet is held. Left out, a controlled head holds once the lips are down and an uncontrolled one holds for the carrying part of its cycle. |
| `cups` | `number` | `5` | Bellows cups on the bar, rounded and clamped to 2–8. |
| `showSheet` | `boolean` | `true` | Draw the sheet and the table it starts on. |
| `label` | `string` | — | Caption below the state 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/suction-gripper.tsx`
