# Slab handset

A touchscreen handset modelled once and turned about its own axis. A quarter turn takes the screen edge on; a half turn shows the back and its camera array.

> 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/slab-handset.json
```

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

## Notes

- A slab has no joints, so the honest mechanism is its attitude. `turn` rotates one model about its own vertical axis and every camera gets the result: the screen goes edge on at a quarter turn and the back comes round at a half, with the side keys crossing over as they should.
- Landscape is not a rotated picture. Rolling a rectangular slab a quarter turn in its own plane leaves it axis-aligned and only swaps its width for its height, so the body is remodelled and the display is laid out again for the shape it is now.
- A silhouette that does not change through a half turn is correct rather than a bug: that is what a rectangular slab does. What changes is which face is toward you.
- No sensors, no radio, no orientation logic — nothing here knows which way up it is except the prop you gave it. The rear array is illustrated, and the display draws structure only.
- An original archetype. No manufacturer, product line, wordmark or paint scheme is reproduced here or in the demo.

## Usage

```tsx
import { SlabHandset } from "@/components/ui/slab-handset"

<SlabHandset screen="map" orientation="landscape" />

// Controlled, or a slab you can turn over.
<SlabHandset turn={160} lenses={3} />
<SlabHandset interactive onTurnChange={setTurn} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"front"` | Where the camera stands. One handset, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `turn` | `number` | — | Controlled rotation about the handset's own vertical axis, degrees. Omit it and it runs behavior. |
| `behavior` | `"turn" | "nudge" | "static"` | `"turn"` | Walk it right round so every face comes past, or work the small range a hand holding it does. |
| `orientation` | `"portrait" | "landscape"` | `"portrait"` | Which way up it is held. Landscape swaps the slab's width for its height and lays the display out again. |
| `speed` | `number` | `0.14` | Revolutions per second, or nudges 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 across the frame to turn it — the whole width is one revolution — or arrow-key it ten degrees at a time. |
| `onTurnChange` | `(turn: number) => void` | — | Rotation in degrees throughout a drag or a key press. |
| `screen` | `"home" | "call" | "map" | "off"` | `"home"` | What the display is showing. Structure in palette roles, never an application's own artwork. |
| `lenses` | `number` | `3` | Lenses in the rear camera array, rounded and clamped to 1–4. |
| `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/slab-handset.tsx`
