Artifact workbench
A React block (a whole screen) in Beamline's AI workspace app.
Where the things an assistant makes are checked before they leave: every document, piece of code, small app and data result from a conversation, each version with what was asked for it, a live preview (the app runs in a sandbox, at desktop or phone width), the source, the changes from any earlier version, a failed version with Ask to fix, and Export in the format the work needs, with the file it made.
Use it for
- An AI product whose answers become things: reports, code, small apps, structured results to inspect, compare and export.
- Reviewing generated output version by version before it ships or is sent.
Not for
- Generating images (image-studio).
- The conversation itself (agent-workspace, conversation-history).
- Reviewing a pull request across many files (file-diff on its own).
Anatomy
- list: the conversation's artifacts with kind, version count and age; one being written shows a spinner, one that failed says so
- header: title, kind and file name; Preview, Source or Changes; the versions (v1 v2 v3) with what was asked for the one shown
- preview: a document on a page; an app running in a sandbox at desktop or phone width with Run again; data as a tree to search and copy; code has no preview and opens on its source
- changes: the differences from the version before, or any earlier one
- footer: which version this is (current or older), Make current for an older one, Export with its format, then the file made (name, size, Download) or why it failed
Variants
- 0: room: the list is a column from 48rem and a picker in the header below that
States
- loading
- nothing made yet
- a version being written (spinner on its tab and in the list; source fills as it comes)
- a version that failed to build or run (the reason, Ask to fix; Export off)
- an older version shown (Make current)
- the first version (Changes has nothing to compare)
- data that isn't valid JSON
- exporting, exported (the file), export failed (the reason; try again)
Keyboard
- Tab: the artifacts, the views, the versions, the preview's controls, Make current and Export
- Arrows move within the views and the versions (segmented controls); ↓ on Export's menu half opens the formats
- The app preview is a frame: Tab enters it and leaves it
Motion
The open artifact's plate travels down the list; a new version's spinner swaps for its number when it is ready; the exported file rises in where the status was. Nothing moves at rest.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
artifacts (required) | Artifact[] | — | { id, title, kind: document · code · app · data, filename?, language?, versions: { id, createdAt, prompt?, content, status?: ready · writing · error, error? }[] } oldest version first. |
selected / defaultSelected / onSelectedChange | string | null | — | |
view / defaultView / onViewChange | "preview" | "source" | "changes" | — | |
formats | Partial<Record<ArtifactKind, { value, label }[]>> | — | Export formats per kind; the first is the default. |
onExport | (artifactId, versionId, format) => Promise<{ name, size?, url? }> | — | Make the file; a rejection's message is shown. |
onRestore | (artifactId, versionId) => void | — | Make an older version the current one. |
onFix | (artifactId, versionId) => void | — | Ask the model to fix a version that failed. |
loading | boolean | — | |
title | string | "Artifacts" | |
className / classNames / style / ref | string / ArtifactWorkbenchClassNames / CSSProperties / Ref<HTMLElement> | — | className: Classes on the documented visual root; no override by default. classNames: Classes for the named visual parts; no overrides by default. style: Inline styles on the documented visual root; no overrides by default. ref: Receives the documented native target or imperative handle; omitted by default. |
selected | string | null | — | |
defaultSelected | string | null | — | |
onSelectedChange | ((id: string) => void) | — | |
view | ArtifactView | — | |
defaultView | ArtifactView | — | |
onViewChange | ((view: ArtifactView) => void) | — | |
className | string | — | Classes on the documented visual root; no override by default. |
classNames | Partial<Record<"root" | "header" | "body" | "footer" | "list" | "versions", string>> | — | Classes for the named visual parts; no overrides by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no overrides by default. |
ref | Ref<HTMLElement> | — | Receives the documented native target or imperative handle; omitted by default. |
Built from
- segmented-control
- select
- response
- code-block
- file-diff
- json-viewer
- split-button
- alert
- badge
- button
- empty-state
- skeleton
- spinner
- text-shimmer
Dependencies
lucide-react
Import
import { ArtifactWorkbench, ARTIFACT_FORMATS } from "@beamline/artifact-workbench";
Get it
Artifact workbench is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent
More in AI workspace
- AI agent workspace: Threads, a conversation that opens on the thread's earlier turns (each with its trace, the tools the agent called, a cited answer and any table it…
- Agent runs monitor: Every run of your agents in one place: success rate, run time, tokens and spend; the last runs as a strip of status blocks; a live table where running…
- Agent monitor: Agents in production and on test. Monitor shows every agent or one over 24 hours, 7 or 14 days: runs, tokens, estimated cost and average run time counted…
- Conversation history: Past conversations with an assistant, ready to pick up again: the list by day with bookmarks and unsent drafts, a search through every message that…
- Knowledge base manager: What your assistant knows and whether it is fresh: sources with live sync status (syncing with progress, out of date, failed with the reason and Retry)…
- Reading library: A read-it-later library: saved views that are live filters (a query with every unreadable part named, the number that matches now, saved with a name; a…
- AI image studio: Write a prompt, pick a shape, a style and how many, and watch the variations generate side by side; each one opens full screen and can be upscaled or…
- Voice agent: A voice agent in three layouts on one session: a workspace with the agent's orb large on a stage (the line being said shows under it, questions to ask…
- Model playground: Try one prompt on up to three models side by side: pick each model with its price and speed in view, set the system prompt, temperature and length once…
- Model inspector: A design model's objects without needing the 3D view: the model tree, where objects with the same name are told apart by id and path; the selected…
- Model issues: Issues pinned to the objects of a design model. The queue says the scope beside every count (open in the project, on the loaded models, on this version)…
- Agent builder: An agent's configuration beside an assistant that proposes tools. Ask for what the agent should do and the assistant's proposal lists each tool with why…
- Workflow composer: A workflow drafted from a sentence and finished by hand. The prompt drafts steps that arrive one by one on the graph (a draft cut short keeps what came…
- Data binding: Bind an object's properties to a view model. Each property says whether it is bound, incomplete or mismatched. A binding takes its source from the…