# Jellyfish

A pulsing bell face on. One contraction number narrows it, deepens it and flares the rim together, and the tentacles hanging off that rim each run their own spine on a delay, so the curtain ripples.

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

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

## Notes

- The pulse is asymmetric on purpose: it squeezes in the first third of the cycle and relaxes over the rest, which is the part that makes it swim rather than flutter.
- Front elevation is the drawing it always had. Off-axis the rim comes out as the circle it is, with every tentacle mounted somewhere on it.
- The bell is an illustrated surface of revolution driven by one number — meridians, margin and all. The tentacles are the spine solver.

## Usage

```tsx
import { RobotJellyfish } from "@/components/ui/robot-jellyfish"

<RobotJellyfish behavior="pulse" arms={11} />

// Or drive the squeeze and the lean yourself.
<RobotJellyfish phase={0.2} contraction={0.85} lean={-0.6} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"front"` | Where the camera stands. One bell, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `behavior` | `"pulse" | "drift" | "bloom" | "static"` | `"pulse"` | What it does when phase is not supplied: squeeze and coast, hang slack, or hold open and feed. |
| `phase` | `number` | — | Controlled cycle fraction. Supplying it stops the internal clock. |
| `speed` | `number` | `0.5` | Contractions per second. |
| `offset` | `number` | `0` | Seconds of offset, so a bloom 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. |
| `contraction` | `number` | — | Bell contraction, 0 relaxed to 1 squeezed. Omit and the behavior works it. |
| `arms` | `number` | `9` | Tentacles round the rim, clamped to 3–16. |
| `segments` | `number` | `10` | Links in each tentacle, clamped to 3–24. |
| `lean` | `number` | — | Lean of the tentacle curtain, −1..1. Omit and it follows the pointer. |
| `interactive` | `boolean` | `true` | The curtain leans toward the pointer, and a click contracts the bell hard. |
| `onPulse` | `() => void` | — | Fired on the click that contracts the bell. |
| `showGround` | `boolean` | `true` | The water column marks behind it. |
| `label` | `string` | — | Caption underneath the bell. |
| `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-jellyfish.tsx`
