Skip to main content

API reference

HyperMarkdown props

PropTypePurpose
mdstringFinished Markdown; ignored in streaming mode.
streamingbooleanReceive content through the imperative handle.
animationbooleanFade arriving words in.
pluginsPluginConfigOptional math, code, diagram, and CJK plugins.
preloadbooleanLoad the configured diagram engine on mount.
componentsRendererComponentsStable tag-to-component overrides.
htmlsanitize | literal | rawRaw HTML policy.
allowedTagsRecord<string, string[]>Additional sanitized tags and attributes.
linkSafetyLinkSafetyConfigAllowed URL protocols and prefixes.
reasoningTargetelement or callbackOptional reasoning portal target.
controlsControlsConfigConfigure block toolbars and reasoning.
translationsPartial<Translations>Override user-facing strings.
iconsPartial<IconMap>Override toolbar SVG markup.
lineNumbersbooleanShow code line numbers; defaults to true.
codeBlockMaxHeightnumber or CSS lengthCode scrolling threshold.
tableMaxHeightnumber or CSS lengthTable scrolling threshold.
scrollDowncallbackRuns after each committed update.
onFullscreenChangecallbackReports fullscreen block state.
onAlertcallbackPresents preview alerts through the host.
classNamestringAdditional root class.

Imperative handle

interface HyperMarkdownHandle {
write(delta: string, finalize?: boolean): void;
reset(): void;
readonly store: HyperMarkdownStore;
/** @deprecated */
readonly stream: HyperMarkdownStore;
}

Most integrations only need write() and reset(). The store is exposed for advanced subscriptions and direct integration.

Exports

The main entry exports HyperMarkdown, its props and handle types, configuration and plugin types, convertMath, and the deprecated MarkdownStream compatibility engine.

Plugin entry points are separate:

import { highlightPlugin } from "@aeven-ai/hypermarkdown/plugins/code";
import { katexPlugin } from "@aeven-ai/hypermarkdown/plugins/math";
import { mermaidPlugin } from "@aeven-ai/hypermarkdown/plugins/mermaid";
import { cjkPlugin } from "@aeven-ai/hypermarkdown/plugins/cjk";