Skip to main content

Introduction

HyperMarkdown is a streaming-native Markdown renderer for React applications and AI interfaces. It renders finished documents, but its architecture is designed around the harder case: a response that changes every few milliseconds and is often syntactically incomplete.

Installnpm install @aeven-ai/hypermarkdownInstallation guide →

Choose your path​

The core idea​

Most renderers receive one growing string. Each token changes that string, so the active document is parsed and reconciled again—even when nearly all of it is already finished. HyperMarkdown takes a different input: the change.

new delta
↓
active block
├── settled code lines → cached
├── settled table rows → cached
├── settled list items → cached
└── changing frontier → parsed

Completed work stays completed. A thousand-line code block does not become a thousand-line parsing problem every time another fragment arrives.

Two rendering modes​

Use finished mode when the complete Markdown already exists:

import "@aeven-ai/hypermarkdown/styles.css";
import { HyperMarkdown } from "@aeven-ai/hypermarkdown";

<HyperMarkdown md={markdown} />

Use streaming mode while an answer is arriving:

<HyperMarkdown ref={renderer} streaming />

Write each new fragment to the mounted renderer. HyperMarkdown owns the active buffer and exposes stable React output through its internal store.

The important contract

write() accepts deltas, not the complete accumulated response. Call write("", true) once when the stream ends so the final open block can settle.

What is included​

CapabilitySupport
MarkdownCommonMark, GFM tables, task lists, autolinks, strikethrough, and footnotes
StreamingIncomplete syntax handling and caches for code lines, table rows, and list items
AI outputCollapsible <think>, <thinking>, and <reasoning> blocks
SafetySanitized raw HTML and configurable link safety controls
Optional pluginshighlight.js, KaTeX, Mermaid, and CJK-friendly emphasis
ReactReact 18 and 19, server rendering, hydration, and Next.js

Heavy features are optional. A project that never renders a Mermaid diagram never downloads Mermaid.

Documentation map​

If you want to…Read
Install the package and stylesInstallation
Render complete MarkdownFinished Markdown
Connect a model or transportStreaming and delta rendering
Control an active rendererImperative handle
Use the App Router or Pages RouterNext.js and SSR
Enable code, math, diagrams, or CJKPlugins
Understand partial syntax while streamingIncomplete Markdown
Configure code and table toolbarsBlock controls
Restrict external links and imagesLink safety
Theme the outputStyling
Compare performance fairlyBenchmarks
Move from another rendererMigration guides