Markdown
v0.64.0, changelogBetaA model's answer in Markdown as the kit's elements, with no dependency: a safe subset (raw HTML as text, http(s) and mailto links only) that parses a growing text without flashing.
API reference
Generated from the types. Every part also takes className.
Markdown
- textrequired
stringThe Markdown text: a model's answer, whole or as it grows.- streaming
boolean = falseThe text is still growing: what is still forming at its end is held back or styled so far (see above).- headingLevel
2 | 3 | 4 | 5 | 6 = 3The level of the text's top headings (# and the first heading under it): 3 by default, under a page's h1 and a section's h2.- cite
(n: number) => ReactNodeRenders a citation token ([1], [^1], [1, 2]) as a marker; without it the tokens are text.citationMarkerfrom citations.- imageOrigins
readonly string[]Origins pictures may load from ("https://cdn.example.com"); pictures from anywhere else are a link with their alt text. None by default.- breaks
boolean = trueEvery line break is a break (true, as a model means it), or only one after two spaces or a backslash (false, as CommonMark).- newTab
boolean = trueOpen http(s) links in a new tab (true), said to screen readers; false keeps them in this one.- labels
Partial<MarkdownLabels>