cd /news/developer-tools/brookmd-streaming-markdown-renderer-… · home topics developer-tools article
[ARTICLE · art-67660] src=github.com ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Brookmd – streaming Markdown renderer in Rust (web, RN, Swift and more)

Brookmd, a streaming Markdown renderer built with a single Rust core, has been released for web, React Native, Swift, and Kotlin platforms. The engine uses incremental parsing with speculative closure for mid-stream constructs and stable block identities to avoid re-reconciling unchanged blocks, compiling to WASM for the web and native libraries for mobile and desktop. It is 100% CommonMark 0.31 + GFM compliant and emits a versioned JSON wire format byte-for-byte across all boundaries.

read2 min views1 publishedJul 21, 2026
Brookmd – streaming Markdown renderer in Rust (web, RN, Swift and more)
Image: source

Streaming markdown for every platform. One Rust core — incremental parse with speculative closure for mid-stream constructs, stable block identities so unchanged blocks never re-reconcile — compiled to WASM for the web and to native libraries for mobile and desktop. Every boundary emits the same versioned JSON wire, byte-for-byte. 100% CommonMark 0.31 + GFM.

In the browser, wire each LLM stream to a BrookClient

and the markdown renders incrementally off the main thread, block by block — so many concurrent streams render without melting the UI thread.

** Live demo** ·

·

Full docs & API →

Changelog

npm i brookmd
js
import { BrookMarkdown } from "brookmd/react";

// `stream` is an AsyncIterable<string> (SSE deltas), a Response, or a ReadableStream
<BrookMarkdown stream={stream} />;

Off the main thread— a pooled Web Worker per stream; the parser re-parses only the active tail on each token, patches cross the worker boundary as verified splices (emitted bytes stay O(n) even for one giant growing block — wire delta mode, contract v1.2.0), and heavy renderers (highlighting, math, mermaid) defer until a block closes.SSR-safe— imports andrenderToString

cleanly on the server across React, Vue, Solid, and Svelte; the worker is created lazily on the client.Structuredblock.data

channel*(opt-in, default off)*— tables, headings, code, math, and lists are exposed astyped, streaming data onblock.kind.data

, so you build toolbars (sort/filter/CSV), tables of contents, charts, and copy buttons from data — no HTML re-parsing, no AST tree to walk.Renderers for every stack— React, Vue 3, Svelte (4 & 5), Solid, a framework-agnostic<brook-markdown>

Web Component, and a vanilla DOM mount on the web; a React Native renderer and Swift/Kotlin/Flutter bindings over the native core (experimental — seePlatforms).Zero runtime dependencies. The whole engine is one WASM binary plus a small TypeScript client.

See the ** package README** for the full API, per-stream config, framework bindings, security model, and scaling helpers (

virtualize

, stickToBottom

).| Path | What | |---|---| packages/brookmd |

crates/brookmd-core

crates.io; compiled to WASM for the npm package. Emits the versioned JSONwire contract.crates/brookmd-ffi

crates/brookmd-cabi

packages/brookmd-react-native

(experimental).brookmd-react-native

packages/brookmd-flutter

bindings/kotlin

bindings/swift

web

md.hsingh.app).The same Rust core streams the same versioned JSON wire (WIRE.md) across every boundary; golden tests pin every binding to byte-identical output.

Platform Use Status
Browser / Node / SSR
brookmd

Stable— publishedon crates.iobrookmd-core

Stable— publishedon npm — native parser via JSI, RN rendererbrookmd-react-native

— SPM packagebindings/swift

BrookMd

over an XCFramework— Android library + uniffi bindingsbindings/kotlin

over the C ABIpackages/brookmd-flutter

+crates/brookmd-cabi

include/brook_md.h

Swift/Kotlin/C-ABI bindings ship prebuilt from CI as checksummed release assets (Android .so

per ABI, Apple XCFrameworks with iOS + macOS slices); the React Native package vendors its binaries in the npm tarball.

bun install
bun run build:wasm        # compile the Rust core → WASM
cd packages/brookmd && bun test

CI enforces the CommonMark 652/652 + GFM conformance floors, the JS test suite, a fresh-process SSR cold-import check, and that the published tarball ships the WASM.

── more in #developer-tools 4 stories · sorted by recency
── more on @brookmd 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/brookmd-streaming-ma…] indexed:0 read:2min 2026-07-21 ·