HelixOverviewComponentsMapsGraphIntroductionInstallationDeriving a themeSandboxTheme builderVisual testingCortexDocsEngramBuildingTraceBuildingRecallDeclaredServicesInsightsGet 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.ExperimentalSince 0.216.0TypographyUsageimport'@fusion.dev/helix/markdown'import'@fusion.dev/helix-headless/markdown'Preview
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
NameDescriptionPreviewA 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.