Block controls and interactivity
HyperMarkdown supplies browser interactions for code blocks, tables, Mermaid diagrams, and reasoning panels. Server rendering produces stable content; these controls become active after hydration.
Default controls
| Block | Controls |
|---|---|
| Code | Copy, fullscreen, and HTML preview for finished html fences |
| Table | Copy and fullscreen |
| Mermaid | Copy diagram source, fullscreen, pan, zoom, and reset view |
| Reasoning | Expand and collapse |
Configure each block
<HyperMarkdown
md={markdown}
controls={{
reasoning: true,
code: { copy: true, fullscreen: true, preview: false },
table: { copy: true, fullscreen: false },
diagram: { copy: true, fullscreen: true, panZoom: false },
}}
/>
Passing false for code, table, or diagram disables that block's controls.
Set diagram.panZoom to false to disable the diagram's zoom buttons,
Ctrl/⌘ wheel zoom, and pointer or touch panning. Passing reasoning: false keeps the
reasoning content but removes its disclosure wrapper.
Host callbacks
<HyperMarkdown
md={markdown}
onFullscreenChange={(fullscreen) => setChromeHidden(fullscreen)}
onAlert={(alert) => showAlert(alert)}
/>
onFullscreenChangereports fullscreen changes from code, table, and diagram blocks.onAlertlets the host present pending or unavailable HTML preview messages instead of relying on renderer-owned UI.scrollDownruns after each committed streaming update, when the new DOM can be measured.
Labels and icons
All renderer-owned strings can be changed through translations, and toolbar
icons can be replaced with inline SVG markup through icons. See
Localization for the complete pattern.