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

Answer Card

Perplexity-style answer with sources. Pro · AI chat and agents › Answers and artifacts

A Perplexity-style answer: the question, a strip of sources, the streamed answer with citation chips, related images, follow-up suggestions and a field to keep asking.

Installation

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

Props

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.

Related components

Previous: Sources · Next: Artifact Panel · All AI chat and agents