Skip to content
Calm motion: animations on this site only fade, with no movement

Artifact panel ​

A side panel for a document that the model writes, with versions, a copy, and a download

Shows the document or the code that an AI assistant makes, next to the chat, so the chat stays short and the work stays in one place.

Basic
  • title names the document. versions is the list of texts, oldest first. Each change from the model adds a version.
  • v-model:version is the index in view. It shows the newest version until the person picks another with the arrows.
  • lang shows the text as code in a code block. Without it, the text shows as a plain document.
  • writing says that the model writes the newest version now. The download waits until it ends, and the body has aria-busy.
  • Copy puts the text in the clipboard, and a status line says so. Download saves it as filename.
  • The ✕ button emits close. The panel is a landmark with a name, such as "Document: Launch plan".
  • Change the words with labels or a label pack. The API table lists the keys.

Usage ​

ts
import { BlessArtifactPanel } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
title*string—
versions*string[]—each version of the document, oldest first
langstring—a code language shows the text as code; leave it out for a plain document
filenamestring"document.txt"the name of the file for the download
writingboolean—the model writes the last version now
labelsPartial<{ panel: string; version: (n: number, total: number) => string; older: string; newer: string; copy: string; copied: string; download: string; close: string; writing: string; }>—
versionnumber—the index of the version in view; the newest by default

Events

NamePayloadDescription
close[]
update:version[value: number | undefined]

Released under the MIT License. Character names and artwork belong to their owners.