AI Answer Preview
ProNewAn answer an AI assistant gave, with your brand and competitors marked where they are named and the sources it cited listed, yours set apart.
Installation
pnpm dlx shadcn@latest add @viewport/ai-answer-preview
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| engine* | stringThe assistant that gave the answer, e.g. "Perplexity". | — |
| prompt* | stringThe question that was asked. | — |
| answer* | stringThe answer's text. Paragraphs are split on blank lines. | — |
| brands* | string[]Names to mark in the answer. The first is yours and is marked strongly; the rest are competitors. | — |
| citations | { domain: string; title?: string; href?: string; own?: boolean }[]The sources the answer cited, in the order it cited them. | [] |
| captured | stringWhen the answer was captured, already formatted. | — |
Accessibility
- Marks say whether they are your brand or a competitor.
- Mentioned or not is stated in words.
- Your own source is labelled for screen readers.
- Server component with no client JavaScript.