Streaming Markdown (e.g. LLM Responses)

Table Of Contents

Render a plain string directly, or feed it in chunk by chunk as it arrives — the typical shape of a streamed LLM response.

public MarkdownRenderer renderer;

// One-shot:
renderer.RenderMarkdown(markdownText);

// Streamed, chunk by chunk (a real token is roughly 3-5 characters):
renderer.BeginStream();
foreach (var chunk in incomingChunks)
    renderer.AppendToStream(chunk);
renderer.EndStream();

The view updates at most once per frame while streaming, and only the still-changing tail of the text is re-parsed — everything already committed is never touched again. If the content sits in a ScrollRect that was already scrolled to the bottom, it stays pinned there as new text arrives.

Multiple renderers at once #

Every MarkdownRenderer streams independently — run several side by side (for example, several chat bubbles arriving concurrently) and they won’t interfere with each other’s styling or content.

See MarkdownStreamDemo.cs for a runnable example that types out a canned answer.

What are your feelings

Updated on 8. September 2026