Skip to content

Markdown

Open .md
Live preview

Loading example…

Safe Markdown renderer: headings, lists, emphasis, inline code, code fences, quotes, tables and links. It builds React elements from a parsed AST, so no input ever reaches innerHTML.

import { Markdown } from "@jcsoftdev/ui/ai";

Single-component entry points tree-shake to just this component: @jcsoftdev/ui/ai/markdown.

<Markdown streaming={false}>
{SAMPLE}
</Markdown>
Prop Type Default Description
children * string Markdown source. Raw HTML is shown as text; only http, https and mailto links are active.
streaming boolean Shows a blinking caret after the last character, for streaming answers.
className string

* marks a required prop.

packages/ui/src/ai/markdown/markdown.tsx