# Input terminal

A bench console with two coupled mechanisms: a head canted on a hinge, and a key deck whose strokes are what put glyphs on its screen.

> 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/input-terminal.json
```

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

## Notes

- The only machine in the set where one mechanism drives another: the glyph count on the screen is the keystrokes the deck has taken, so the cursor sits wherever the keys have got to. Scrub the passage and both move together, because they are the same number.
- Two mechanisms means two controlled props. `cant` is the one you grab, and the loop keeps running while `typed` is still the machine's own — a head held by hand carries on typing underneath it, which is what pinning a value while the clock runs on is for. Supplying both, or `behavior="static"`, parks everything.
- The head is hinged up a column at the back of the case rather than on the deck's own edge, which is what makes this a console rather than a machine that folds shut. `clamshell-laptop` is the one that folds.
- It computes nothing. The screen draws structure — a status band, filled lines, a block cursor — and never text: no encoding, no shell, no output, and no application's artwork.
- An original archetype. No manufacturer, product line, wordmark or paint scheme is reproduced here or in the demo.

## Usage

```tsx
import { InputTerminal } from "@/components/ui/input-terminal"

<InputTerminal behavior="session" screen="query" />

// Controlled — two scalars, because it has two mechanisms.
<InputTerminal cant={18} typed={0.6} screen="log" lines={10} />
<InputTerminal interactive onCantChange={setCant} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"front"` | Where the camera stands. One console, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `cant` | `number` | — | Controlled head angle, degrees back from upright, clamped 6–45. Omit it and the head runs behavior. |
| `typed` | `number` | — | Controlled position through the passage, 0 to 1. Omit it and the keys run behavior. |
| `behavior` | `"session" | "query" | "idle" | "static"` | `"session"` | Set the head, type under it and lay it back; type with the head parked; sit with the cursor blinking; or stop. |
| `screen` | `"boot" | "log" | "query" | "off"` | `"query"` | What the display is showing. Structure in palette roles — a status band, filled lines, a block cursor — never text. |
| `lines` | `number` | `7` | Lines the screen holds, rounded and clamped to 4–12. The passage fills exactly that many. |
| `speed` | `number` | `0.2` | Sessions 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 down the frame to lay the head back, or arrow-key it 3° at a time; Shift 10°, Home and End upright and right back. |
| `onCantChange` | `(cant: number) => void` | — | Head angle throughout a drag or a key press. |
| `showDesk` | `boolean` | `true` | The contact shadow under the case. |
| `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/input-terminal.tsx`
