Skip to content

Streaming Answer

Premium

An assistant answer that streams in word by word, already formatted, with new words fading in, a stop and continue control, and message actions.

AI Agent UIChat assistantsAI writing toolsDocumentation bots
Working on an answer

Searching 4 sources

Examples

Streaming markdown answer
Working on an answer

Reading src/date.ts

Waiting for sources
Working on an answer

Searching 3 sources

Stopped halfway
Stopped

Stopped writing

36 words

The bug is in how parseDate handles offsets. It strips the +02:00 suffix, so every time is read as UTC.

Here is the fix:

tsstopped3 lines
export function parseDate(input: string) {
const d = new Date(input)
return Number.isNaN(d.getTime())
Finished without an answer
Answer ready

No answer came back

The agent finished without writing an 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.

PropTypeDefaultDescription
markdownstring-Supplies the answer parsed and revealed as Markdown; left out, the demo uses sample text and host mode uses an empty answer, while passing it turns the demo off.
statusTokenStreamStatus-Controls waiting, writing, done or stopped presentation; left out, host mode infers done from nonempty Markdown and waiting otherwise, while passing it turns the demo off.
waitingPhrasesstring[]-Supplies rotating work messages before the answer; left out, the demo uses sample messages and host mode shows none, while passing it turns the demo off.
wordsPerSecondnumber-Sets a positive reveal speed; left out or nonpositive, the tuned word timing is used.
labelstring-Adds metadata text to the answer header; left out, no label is shown, while passing it turns the demo off.
onStop() => void-Handles stopping and makes the stop control available during host writing; left out, host streams have no stop control.
onContinue() => void-Handles continuing and makes the Continue control available after a host stop; left out, host stopped answers have no Continue control.
onRetry() => void-Handles retrying and makes retry controls available in host mode; left out, host answers have no retry controls.
onFeedback(value: 'up'|'down'|null) => void-Reports the current rating while rating state remains local; left out, rating controls still update locally.
elapsedMsnumber-Shows how long a host answer took in milliseconds; left out, no host duration is shown, while passing it turns the demo off.
classNamestring-Adds classes to the outermost root; left out, only the built-in classes are used.
tuningPartial<Tuning>-Overrides stream measurements, timing and motion values; left out, every value in TUNING is used.

About Streaming Answer

Token Stream renders an answer as it arrives: inline markdown, lists, headings and fenced code, with a steady word by word reveal that smooths bursty delivery. An open code fence renders as code from its first character, so nothing reflows when it closes. The cursor blinks only while waiting, Stop freezes what you have and Continue resumes, and if the reader scrolls up a small Jump to latest pill appears instead of dragging them down. Feed it chunks or a controlled content string; without props it streams a scripted answer on a loop.

Built with

MotionTailwind CSS

Frequently asked questions

Is Streaming Answer free to use?
Streaming 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 Streaming 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 Streaming Answer built with?
Streaming Answer is built with React and TypeScript, using Motion and Tailwind CSS. It ships with both light and dark styling.
Where would I use Streaming Answer?
Common uses include Chat assistants, AI writing tools, and Documentation bots. Like every AI Canvas component, it is self-contained and drops into any React project.
Can I remix Streaming Answer with AI?
Yes. Open "Remix with AI" on this page to read the setup and the constants Streaming 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