logoassistant-ui

Markdown

Display rich text with headings, lists, links, and code blocks.

Markdown Rendering

This is a paragraph with bold text, italic text, and links.

  • First item
  • Second item
  • Third item

This is a blockquote with some quoted text.

NameValue
Alpha100
Beta200

Markdown support is already included by default in the Thread component.

Enabling markdown support

Add markdown-text

npx shadcn@latest add @assistant-ui/markdown-text

This adds a /components/assistant-ui/markdown-text.tsx file to your project, which you can adjust as needed.

Use it in your application

Pass the MarkdownText component to the MessagePrimitive.Parts component

/components/assistant-ui/thread.tsx
import {  } from "@/components/assistant-ui/markdown-text";

const :  = () => {
  return (
    <. ="...">
      < ="...">
        <. ={{ :  }} />
      </>
      < />

      < ="..." />
    </.>
  );
};

Syntax highlighting

Syntax Highlighting is not included by default, see Syntax Highlighting to learn how to add it.