ValyroUI English version

Artifact Panel

Панель артефакта рядом с чатом. Pro · ИИ: чат и агенты › Ответы и артефакты

Установка

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';

Пропсы

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.

Похожие компоненты

  • Sources — Источники и цитаты в ответе
  • Answer Card — Ответ с источниками в стиле Perplexity
  • Diff Review — Ревью правок ИИ по фрагментам
  • AI Chat Window — Окно AI-чата
  • Chat Message — Сообщения с потоковым выводом
  • Message Branches — Версии сообщения и дерево веток диалога
  • Streaming Text — Плавный вывод потока токенов
  • Markdown Preview — Отображение Markdown
  • Response Feedback — Оценка ответа и рубрика для асессоров
  • Prompt Composer — Поле промпта с вложениями
  • Inline Suggestion — Подсказка-автодополнение в поле ввода
  • Model Selector — Выбор модели ИИ

Назад: Answer Card · Далее: Diff Review · Весь раздел «ИИ: чат и агенты»