DesignOverviewDesign SystemMapsGraphIntroductionInstallationDeriving a themeSandboxTheme builderVisual testingAgentsCortexMemoryActiveProvenanceActiveContextActiveServicesInsightsGet in touchSource on GitHub
Loading the reference
MarkdownView sourceEdit in SandboxView MarkdownCopy MarkdownOpen in ClaudeOpen in CursorMarkdown drawn as a document, which streams in place as a reply arrives.Also called Markdown renderer, Streaming text, and Rich text.ExperimentalSince 0.216.0TypographyImportimport'@fusion.dev/helix/markdown'import'@fusion.dev/helix-headless/markdown'Preview
GuidelinesWhen to use
A reply that arrives as Markdown while you watch, such as an agent's answer.Markdown you already have, such as a README, drawn as a document.MarkdownThis page
Set text to everything a reply has said so far, with streaming while more is coming.Each time text grows, only what changed is drawn.
Put data-prose on the element or on a container.The page's prose recipe then sets the document's type, spacing, lists, and tables.
On a server, render markdownToHtml(text) inside the element.The element keeps markup that matches what it would draw, and draws nothing again.
API referenceRoothelix-markdownMarkdown drawn as a document, which streams in place as a reply arrives.
PropTypeDescriptioncautionHeadingstringDefault"Caution"The heading of a > [!CAUTION] alert.importantHeadingstringDefault"Important"The heading of a > [!IMPORTANT] alert.noteHeadingstringDefault"Note"The heading of a > [!NOTE] alert.streamingbooleanDefaultfalseWhether more text is coming. While it is set, the end of text is read
as a block still arriving, and the element is busy to assistive
technology. Clear it when the reply ends, and the last block is read as
finished.textstringDefault""The Markdown. Set it to the whole reply so far each time more arrives: a
text that starts with the one before is drawn by its new end alone.tipHeadingstringDefault"Tip"The heading of a > [!TIP] alert.warningHeadingstringDefault"Warning"The heading of a > [!WARNING] alert.
ReadTypeDescriptionwhenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The drawn document. Written by the element; leave it empty, or fill it with markdownToHtml(text) on a server.
MethodTypeDescriptionappendText(chunk: string) => voidAdds text to the end of the document, as a chunk of a stream arrives.
The same as setting text to the text so far.
Custom stateDescriptionsettledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.streamingWhile streaming is set and more text is expected.
Roothelix-headless-markdownMarkdown drawn as a document, which streams in place as a reply arrives.
PropTypeDescriptioncautionHeadingstringDefault"Caution"The heading of a > [!CAUTION] alert.importantHeadingstringDefault"Important"The heading of a > [!IMPORTANT] alert.noteHeadingstringDefault"Note"The heading of a > [!NOTE] alert.streamingbooleanDefaultfalseWhether more text is coming. While it is set, the end of text is read
as a block still arriving, and the element is busy to assistive
technology. Clear it when the reply ends, and the last block is read as
finished.textstringDefault""The Markdown. Set it to the whole reply so far each time more arrives: a
text that starts with the one before is drawn by its new end alone.tipHeadingstringDefault"Tip"The heading of a > [!TIP] alert.warningHeadingstringDefault"Warning"The heading of a > [!WARNING] alert.
ReadTypeDescriptionwhenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The drawn document. Written by the element; leave it empty, or fill it with markdownToHtml(text) on a server.
MethodTypeDescriptionappendText(chunk: string) => voidAdds text to the end of the document, as a chunk of a stream arrives.
The same as setting text to the text so far.
Custom stateDescriptionsettledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.streamingWhile streaming is set and more text is expected.
Examples
NameDescriptionCheckedA Markdown task list, its done and open tasks drawn as read-only checkboxes.PreviewA Markdown document with a list, a code block, an alert, and a table.PreviewA Markdown document with a list, a code block, an alert, and a table.StreamingA reply that streams in as Markdown, a few characters at a time, without moving the text above it.