Documents
markdown
markdown
Type
External
Status
Published
Created
Mar 17, 2026
Updated
Apr 28, 2026
Updated by
Dosu Bot
Source
View

import { MarkdownSample } from "@/components/docs/samples/markdown";

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

Enabling markdown support#

### Add `markdown-text`

<InstallCommand shadcn={["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

import { MarkdownText } from "@/components/assistant-ui/markdown-text";

const AssistantMessage: FC = () => {
  return (
    <MessagePrimitive.Root className="...">
      <div className="...">
        <MessagePrimitive.Parts>
          {({ part }) => part.type === "text" ? <MarkdownText /> : null}
        </MessagePrimitive.Parts>
      </div>
      <AssistantActionBar />

      <BranchPicker className="..." />
    </MessagePrimitive.Root>
  );
};

Syntax highlighting#

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