# Voxel form

The workpiece on its own, with no machine around it. A continuous field sampled at your resolution and drawn as vector cells, so it can sit in a hero, a card or a loading state without a gantry bolted to it.

> 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/voxel-form.json
```

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

## Notes

- The same geometry every fabricator in the set builds — one field, one deposition order, one set of vector cells. Pick this when you want the object and not the machine.
- Cells buried inside the solid are never drawn. Raising the resolution rebuilds the same object out of smaller cells rather than making it bigger.

## Usage

```tsx
import { VoxelForm } from "@/components/ui/voxel-form"

<VoxelForm shape="gear" behavior="refine" showPlate={false} />

// Controlled, or a control:
<VoxelForm progress={0.6} resolution={9} />
<VoxelForm interactive onProgressChange={setProgress} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `shape` | `"sphere" | "block" | "pyramid" | "gear" | "vessel" | "lattice"` | `"sphere"` | Which occupancy field to sample. |
| `resolution` | `number` | `6` | Voxels along one edge, rounded and clamped to 2–14. Omit it under behavior="refine" and it animates. |
| `progress` | `number` | — | Controlled build fraction, clamped to 0–1. A non-finite value empties the plate. |
| `behavior` | `"build" | "layer" | "refine" | "idle" | "static"` | `"build"` | The shared fabricator cycle: lay the object and clear, work one layer, walk the resolution coarse to fine, or stand complete. |
| `speed` | `number` | `0.14` | Build 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 up and down to lay or strip material; arrow keys step one layer. |
| `onProgressChange` | `(progress: number) => void` | — | The commanded build fraction, fired throughout a drag or a key press. |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"iso"` | Where the camera stands. One model, four projections. |
| `showPlate` | `boolean` | `true` | The plate the form stands on. Off, and it floats. |
| `showGround` | `boolean` | `true` | Contact shadow underneath. |
| `label` | `string` | — | Caption underneath the form. |
| `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/voxel-form.tsx`
