Skip to content

Cited Answer

Premium

An answer with numbered citations: pick a number or a source to see the quoted passage and whether it really backs the sentence.

AI Agent UIResearch assistantsAI searchDocumentation bots

Do streaming answers feel faster?

Writing the answer

Streaming answers feel faster because the first words arrive in under 300 ms. The full answer often takes six seconds or more. People judge speed by that first signal, not by the total time. Showing which tool is running also lowers perceived wait.No source

Press [ and ] to step through claims, Escape to clear.

Examples

Answer with three sources

How should a streaming answer show progress?

3 of 4 claims cited

Streaming can show useful text before the full answer is complete. The runtime guide separates first content from full completion. Product guidance recommends pairing streamed text with an accurate progress label. Teams can tune these signals to match the work their agent performs.No source

Press [ and ] to step through claims, Escape to clear.

  • Supports
    Start rendering an answer when the first complete text segment is ready, and keep the progress label aligned with the current operation.
    Streaming responses
Sentence 1, source 1, Streaming response guidelines: Supports.
Controlled source selection

How should a streaming answer show progress?

3 of 4 claims cited

Streaming can show useful text before the full answer is complete. The runtime guide separates first content from full completion. Product guidance recommends pairing streamed text with an accurate progress label. Teams can tune these signals to match the work their agent performs.No source

Press [ and ] to step through claims, Escape to clear.

  • Partly
    The first-content event is emitted separately from the completion event so interfaces can represent both states.
Sentence 2, source 2, Runtime event reference: Partly.
Answer without sources

Which command opens the project?

0 of 1 claim cited

Run the open-project command from the workspace menu.No source

Press [ and ] to step through claims, Escape to clear.

Nothing was cited for this answer.

Add to your projectPremium component

One command adds this component to your project.

1

Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.

npx shadcn@latest add @aicanvas/••••••••••••
2

For dark mode, add the dark class to your <html> element:

Optional
<html class="dark">

Install with AI Canvas MCP

With AI Canvas MCP, your AI knows every component we ship. Ask for one inside Claude Code, Codex, or Cursor and it installs the component you pick. Works with any AI Canvas account, free or premium.

Props

Every prop this component accepts. Any other prop is forwarded to the underlying element.

CitedSentence

PropTypeDefaultDescription
textreqstring-Answer sentence shown in the claim text.
cites(string|number)[]-Source ids attached as numbered citations; left out, the sentence is flagged as having no source.

CitedSource

PropTypeDefaultDescription
idreqstring|number-Stable source identifier that must be unique within the sources list.
titlereqstring-Source title shown in the rail and evidence pane.
domainreqstring-Source domain shown below its title.
verdictVerdict-Labels cited evidence as supporting, partial or contradictory; left out, no verdict tag is shown.
quotestring-Passage shown when the source backs a claim; left out, a cited source says that no passage was provided.
highlight[number, number][]-Zero-based ranges emphasized within the passage; left out, no passage text is emphasized.
locatorstring-Page or section locator shown below the passage; left out, no locator is shown.
hrefstring-Absolute HTTP or HTTPS address used by the Open action; left out or invalid, Open appears only when onOpenSource is passed.

ActiveClaim

PropTypeDefaultDescription
sentencereqnumber|null-Zero-based sentence index, or null to open a source that no sentence cites.
sourcereqstring|number-Id of the source selected in the rail.

SourceRail

PropTypeDefaultDescription
questionstring-Sets the heading above the answer; left out, the demo uses its sample question and host mode falls back to Answer, while passing it turns the demo off.
sentencesCitedSentence[]-Supplies answer sentences and citation links; left out, the demo uses sample claims and host mode shows no answer text, while passing it turns the demo off.
sourcesCitedSource[]-Supplies source rows and evidence; left out, the demo uses sample sources and host mode shows none, while passing it turns the demo off.
activeActiveClaim|null-Controls the selected claim or source, with null closing the evidence pane; left out, selection is managed internally, while passing it turns the demo off.
defaultActiveActiveClaim|null-Sets the initial uncontrolled selection; left out, host mode selects the first valid cited claim, while passing it turns the demo off.
onActiveChange(active: ActiveClaim | null) => void-Reports claim and source selection changes; left out, uncontrolled selection still works locally.
onOpenSource(source: CitedSource) => void-Handles the Open action and makes it available without a valid href; left out, Open requires a valid source href.
classNamestring-Adds classes to the outermost root; left out, only the built-in classes are used.
tuningPartial<Tuning>-Overrides rail measurements, timing and motion values; left out, every value in TUNING is used.

About Cited Answer

Source Rail puts citations next to an agent answer: numbered markers inside the text, a rail of sources beside it, and hover cards with the exact quoted passage. Hovering a marker highlights its source and hovering a source lights every marker that cites it, each marker can show how directly its source supports the claim, and on narrow screens the rail folds into a strip of chips that open the quote as a sheet. Markers sit in the tab order, Enter opens a card, arrows move through the rail. Sources and text are props; without them a demo walks through its own citations.

Built with

MotionTailwind CSS

Frequently asked questions

Is Cited Answer free to use?
Cited Answer is a Premium AI Canvas component. Premium unlocks the full source code, the full remix prompt, and one-command installs for every Premium component, block, and template.
How do I install Cited Answer?
Premium unlocks one-command installs: run the shadcn CLI with your AI Canvas token, or connect the AI Canvas MCP server and ask your AI editor to install it for you. Premium also unlocks the full remix prompt in the Remix panel.
What is Cited Answer built with?
Cited Answer is built with React and TypeScript, using Motion and Tailwind CSS. It ships with both light and dark styling.
Where would I use Cited Answer?
Common uses include Research assistants, AI search, and Documentation bots. Like every AI Canvas component, it is self-contained and drops into any React project.
Can I remix Cited Answer with AI?
Yes. Open "Remix with AI" on this page to read the setup and the constants Cited Answer is built from. The engine, the markup and the notes on how it works are part of Premium. For the exact component, install it with the one-command CLI.

Featured in collections

More like this