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';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
title * | ReactNode | Artifact 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. |
language | string | Highlighting and the type badge for code artifacts, e.g. tsx. | |
versions * | ArtifactVersion[] | Every version, oldest first. The latest is shown unless version picks another. | |
version | number | 0-based index of the shown version. Uncontrolled, the panel follows the latest one. | |
defaultVersion | number | Initial version when uncontrolled. | |
onVersionChange | (index: number) => void | Called with the new version when it changes. | |
onRestore | (index: number) => void | Adds "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) => void | Called with the new view when it changes. | |
renderPreview | (content: string) => ReactNode | Preview for code artifacts, e.g. a sandboxed iframe. Without it a code artifact shows only its source. | |
streaming | boolean | false | The latest version is still being written. |
onDownload | (version: ArtifactVersion, index: number) => void | Adds a Download button. | |
fullscreen | boolean | Controlled fullscreen; use with onFullscreenChange. | |
defaultFullscreen | boolean | false | Initial fullscreen when uncontrolled. |
onFullscreenChange | (fullscreen: boolean) => void | Called with the new fullscreen when it changes. | |
onClose | () => void | Adds a Close button. | |
sheetBreakpoint | number | 768 | With onClose, viewports narrower than this (px) show the panel as a full-screen sheet. Default 768; 0 turns it off. |
locale | string | BCP 47 locale for version dates; defaults to the ThemeProvider's. | |
labels | Partial<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 · Весь раздел «ИИ: чат и агенты»