SuperAPI AI Directory

Markstream

Open-source streaming Markdown renderer for AI chat interfaces, with incomplete-token handling and packages for Vue, React, Svelte, Angular, and Vue 2.

Open website

About this tool

Purpose

Markstream is a streaming Markdown renderer for AI applications, designed to solve the stability and smoothness issues of rendering Markdown content when large language models (LLMs) output token by token and push in real time via SSE/WebSocket. It can be widely used in AI chat interfaces, documentation sites, and other scenarios that require real-time Markdown rendering.

Main Capabilities

  • Supports multiple mainstream frontend frameworks: Vue, React, Svelte, Angular, Nuxt, and Next.js.
  • Streaming rendering: can handle LLM token streams, SSE/WebSocket output, AI chat messages, and long documents.
  • Incomplete syntax handling: during streaming, when encountering unclosed Markdown syntax (such as unfinished emphasis markers, code blocks, links, etc.), it can still maintain a renderable and stable display effect.
  • Progressive Mermaid: Mermaid diagrams can render at the moment the syntax is closed.
  • KaTeX support: inline formulas such as H₂O, x², etc. can render normally.
  • Streaming code blocks: code blocks appear progressively with the stream and support streaming diff code blocks.
  • Incremental parsing and stable DOM reuse: improves performance in scenarios with long documents and high-frequency updates.
  • Built-in 42 components; the official website displays all components with autoplay, and each wavy line replays its Markdown as a token stream, pausing on hover.
  • Supports streaming citation annotations (such as [1]) and anchor arrows that jump back to the citation source.
  • Custom containers can wrap any block-level content.
  • The v2 version adds insert markup for supplementing content.

How to Use

  • Beginners can start with Vue Quick Start and complete their first render in about 10 minutes.
  • You can browse all renderable components through the component gallery, and each card is a live rendering example.
  • Installation example:pnpm add markstream-vue.
  • The documentation is organized by task: Get Started (installation, quick start, streaming usage), Components (component gallery, overrides, custom tags, single-component pages), Guides by Task (VitePress integration, streaming, performance, security), Troubleshooting (troubleshoot by symptom), Customize, Frameworks & Migration, and Reference (advanced deep dives).
  • Supports embedding VitePress or a content hub as a documentation site renderer.
  • Supports Tailwind and custom styles.

Applicable Scenarios

  • Building AI chat applications that display SSE or token output in a streaming way and avoid flicker.
  • Running documentation sites and embedding the renderer into VitePress or a content hub.
  • Scenarios that need to render long documents while maintaining high performance.
  • Scenarios that need progressive rendering of Mermaid diagrams, KaTeX formulas, and code blocks.

Limitations

The materials do not currently provide more information about pricing, cost, platform compatibility details, performance benchmark values, or specific usage steps.