Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Sandbox Row

ProNew

One sandbox in a list: a copyable ID, its template, region and state, processor and memory meters, and pause, shell and kill, where kill asks for a second press.

Installation

pnpm dlx shadcn@latest add @viewport/sandbox-row

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
id*string

The sandbox's identifier, shown in a monospace face with a copy button.

—
template*string

The image or template it was started from.

—
state*"running" | "starting" | "paused" | "failed" | "stopped"—
regionstring

Where it runs and how long it has been up, already formatted.

—
uptimestring—
cpunumber

Processor and memory in use, from 0 to 100.

—
memorynumber—
onPauseChange(paused: boolean) => void—
onKill() => void

Stops the sandbox for good. The button asks for a second press first.

—
onOpen() => void

Opens a shell or the logs.

—
classNamestring—

Accessibility

  • State is written out beside the dot.
  • Kill says what the second press will do and disarms when focus leaves.
  • Meters are meter elements; a high reading is bold as well as red.
  • Actions that do not apply are disabled, not removed.
  • Respects prefers-reduced-motion.