ValyroUI English version

Answer Card

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

Установка

npx valyro-cli@latest login
npx valyro-cli@latest add answer-card
npm install valyro-ui-pro

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

Пропсы

PropTypeDefault
query *stringThe question, shown as the heading.
answer *stringMarkdown answer with [1]-style citations; grows while streaming (unfinished markup is closed on the fly).
streamingbooleanfalseThe answer is still being written.
sourcesCitationSource[][]Sources the citations point to, numbered from 1. Placeholder cards show while streaming without any.
imagesAnswerCardImage[][]Related image thumbnails in their own section; one with href opens it in a new tab.
relatedstring[][]Suggested follow-up questions.
onRelatedSelect(question: string) => voidCalled with the question when a related suggestion is clicked. Suggestions are hidden while streaming.
onFollowUp(question: string) => voidShows a follow-up field; called with the question.
onRegenerate() => voidAdds a Rewrite action.
headingLevel1 | 2 | 3 | 4 | 52Heading level of the query (the section titles are one below). Default 2.
markReactNodeThe tile beside "Answer": the assistant's logo or avatar. Default: a monogram of labels.assistant.
localestringBCP 47 locale for source dates; defaults to the ThemeProvider's.
labelsPartial<AnswerCardLabels>Overrides for the built-in English text; keys left out keep their defaults.

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

Назад: Sources · Далее: Artifact Panel · Весь раздел «ИИ: чат и агенты»