ValyroUI Русская версия

Artifact Panel

Artifact panel next to the chat. Pro · AI chat and agents › Answers and artifacts

Side panel for a generated document or code file, beside a chat: preview, source, versions.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add artifact-panel
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { ArtifactPanel } from 'valyro-ui-pro';

Props

PropTypeDefault
title *ReactNodeArtifact name in the header; also labels the panel for screen readers.
kind'document' | 'code''document'document previews as Markdown; code shows highlighted source. Default document.
languagestringHighlighting and the type badge for code artifacts, e.g. tsx.
versions *ArtifactVersion[]Every version, oldest first. The latest is shown unless version picks another.
versionnumber0-based index of the shown version. Uncontrolled, the panel follows the latest one.
defaultVersionnumberInitial version when uncontrolled.
onVersionChange(index: number) => voidCalled with the new version when it changes.
onRestore(index: number) => voidAdds "Restore this version" while an older version is shown.
view'preview' | 'code'Controlled view; use with onViewChange.
defaultView'preview' | 'code''preview'Initial view when uncontrolled.
onViewChange(view: ArtifactView) => voidCalled with the new view when it changes.
renderPreview(content: string) => ReactNodePreview for code artifacts, e.g. a sandboxed iframe. Without it a code artifact shows only its source.
streamingbooleanfalseThe latest version is still being written.
onDownload(version: ArtifactVersion, index: number) => voidAdds a Download button.
fullscreenbooleanControlled fullscreen; use with onFullscreenChange.
defaultFullscreenbooleanfalseInitial fullscreen when uncontrolled.
onFullscreenChange(fullscreen: boolean) => voidCalled with the new fullscreen when it changes.
onClose() => voidAdds a Close button.
sheetBreakpointnumber768With onClose, viewports narrower than this (px) show the panel as a full-screen sheet. Default 768; 0 turns it off.
localestringBCP 47 locale for version dates; defaults to the ThemeProvider's.
labelsPartial<ArtifactPanelLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Answer Card · Next: Diff Review · All AI chat and agents