Overview
Overview
The components property is the primary extension point in @ant-design/x-markdown. It lets you map Markdown/HTML nodes to your own React components so you can control rendering, streaming behavior, and business data interaction in one place. To extend further, see Plugins and custom renderers.
import React from 'react';import { Mermaid, Think, XMarkdown } from '@ant-design/x';<XMarkdowncomponents={{think: Think,mermaid: Mermaid,}}/>;
| Property | Description | Type | Default |
|---|---|---|---|
| domNode | Component DOM node from html-react-parser, containing parsed DOM node information | DOMNode | - |
| streamStatus | Streaming rendering supports two states: loading indicates content is being loaded, done indicates loading is complete. Currently only supports HTML format and fenced code blocks. Since indented code has no clear end marker, it always returns done status | 'loading' | 'done' | - |
| children | Content wrapped in the component, containing the text content of DOM nodes | React.ReactNode | - |
| rest | Component properties, supports all standard HTML attributes (such as href, title, className, etc.) and custom data attributes | Record<string, any> | - |
components.streamStatus to separate loading UI (loading) from finalized UI (done).streamStatus === 'done'.If block-level custom tags contain unexpected blank lines, Markdown parsers may end the HTML block early and convert trailing content into paragraphs. To avoid this: