Skip to content

Generative DOMMarkdown rendering built for streaming

Stream-first parser that renders markdown chunk by chunk — perfect for LLM output, WebSocket feeds, and real-time content.

See It in Action

Streaming vs. Batch Rendering

Traditional parsers re-parse everything on each update. Generative DOM processes only new chunks.

ts
import { GenerativeDom } from '@generative-dom/core';
import { markdownBase, markdownInline, markdownHeading } from '@generative-dom/plugins';

const md = new GenerativeDom({
  container: document.getElementById('output'),
  plugins: [markdownBase(), markdownInline(), markdownHeading()],
});

// Stream from any source — LLM, WebSocket, file reader
for await (const chunk of stream) {
  md.push(chunk);  // Renders incrementally
}
md.flush();

Three lines of integration code. The rest is your streaming source.

Why Generative DOM?

Generative DOMmarkedmarkdown-itremark
StreamingNativeBatch onlyBatch onlyBatch only
Plugin SystemAll syntaxLimitedGoodRich
Bundle Size< 5 KB~ 7 KB~ 12 KBLarge (multi-pkg)
DependenciesZeroZeroZeroMany
XSS SafetyArchitectural (DOM API)Sanitizer requiredSanitizer requiredSanitizer required
SSRNo (browser only)YesYesYes

Generative DOM is not a general-purpose replacement for batch parsers. It is the tool for the job they were not designed for: rendering markdown that arrives piece by piece.

Who Uses Generative DOM?

LLM Client Developers — Build ChatGPT-like UIs with smooth token-by-token rendering. No flickering, no re-parsing, no scroll position loss.

Real-Time App Developers — WebSocket feeds, collaborative editors, live previews. Generative DOM handles arbitrary chunk boundaries without breaking syntax.

Security-Conscious Teams — Zero innerHTML means zero XSS vectors from markdown content. Security is structural, not a filter bolted on after the fact.

Try the Full Playground

Experience Generative DOM with all 11 plugins, streaming controls, chunk-size tuning, and event monitoring.

Open Playground