Output & generative UI
Artifact
Use when the agent produces a document people will read, revise and take elsewhere, not a reply to scroll past.
Generated content in a versioned container with preview and raw views.
Part of Output & generative UI. The stage where the response is a thing, not a paragraph: a document, a set of edits, a record, a chart. These patterns give that output a container the user can review, accept in part, and come back to later.
Do
- Give the output a title and its own container, separate from the thread.
- Keep every version and say what changed in each one.
- Offer the raw source beside the preview, plus copy and download.
Don't
- Don't overwrite the previous version when the agent revises.
- Don't put short answers in an artifact. A two-line reply belongs in the thread.
- Don't hide the raw text. People paste it into other tools.
States
- Latest version: The preview tab shows the newest version, with a note on what changed. The next-version control is disabled.
- Earlier version: Stepping back swaps the body and the change note. At the first version the previous control is disabled.
- Markdown: The second tab shows the same version as raw markdown in a mono block.
- Copied: The copy icon becomes a green tick for a moment.
Usage
import { ArtifactPattern } from "./halaska-kit";
<ArtifactPattern />
Built from
Related patterns
Halaska UI · Components · Patterns · Screens · Install