Launch priceOne payment

Streaming Response

Pass the growing Markdown string on every chunk. Half-written bold, an unclosed code fence and a table mid-row each render as what they are about to become, bursty chunks are metered into a steady pace, and each new word fades in behind a caret. No Markdown dependency.

AI ChatFree669 lines · one file

Ready for AI tools one file typed props installs by name prompt included

The decision inside it

It reads Markdown that is not finished yet

A normal renderer shows raw asterisks and pipes until the closing mark arrives, then jumps. This one treats an opener with no closer as open to the end, so the text never redraws itself under the reader.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Layro's Streaming Response for this.
Install it: npx shadcn@latest add https://layropro.com/r/streaming-response
Import it from @/components/ui/streaming-response.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above.

API

“Copy prompt” above puts a full brief on your clipboard — install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

PropTypeNotes
textrequiredstringThe answer so far, as Markdown. Pass the whole growing string on every chunk.
streamingbooleanTrue while more is coming. Shows the caret and fades new words in.
smoothbooleanEven out bursty chunks so the text arrives at a steady pace. Default true.
animateWordsbooleanFade each word in as it arrives. Default true.
onSettled() => voidCalled once the last character is on screen: `streaming` is false and the pacing has caught up.
onCopyCode(code: string, language?: string) => voidCalled with the code when a block's Copy is pressed.

Dependencies

npm packages

clsxframer-motionlucide-reacttailwind-merge

Layro foundations, installed alongside it

layro-themebutton

Lifetime access

Every component, and everything we ship next.

  • All 112 components, source included
  • The template, and everything released after you buy
  • shadcn CLI or download — React 18/19, Tailwind v4
  • One payment. No subscription.

More in AI Chat

All AI Chat components