logoAnt Design X

DesignDevelopmentComponentsX SDKX MarkdownPlayground
  • Introduction
  • Code Examples
  • Streaming Rendering
  • Components
  • Themes
  • Plugins
    • Overview
    • LatexFormula
    • HighlightCode
    • MermaidDiagram
    • CustomPlugins

Code Examples

Resources

Ant Design
Ant Design Charts
Ant Design Pro
Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Web3
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
Twitter
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference

Help

GitHub
Change Log
FAQ
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community

When To Use

Used for rendering streaming Markdown format returned by LLMs.

Code Demos

API

PropertyDescriptionTypeDefault
contentMarkdown contentstring-
childrenMarkdown content, same as contentstring-
componentsCustom componentsRecord<string, React.FC<ComponentProps>>, see details-
paragraphTagCustom paragraph rendering tag. Avoids errors from p tags wrapping divs in custom components.stringp
streamingStreaming rendering configurationSteamingOption, see details-
configMarked.js extensionMarkedExtension{ gfm: true }
classNameCustom classNamestring-
rootClassNameRoot node custom className, same as classNamestring-
styleCustom stylesCSSProperties-

SteamingOption

PropertyDescriptionTypeDefault
hasNextChunkWhether there is another chunk. If false, clears all cache and renders.booleanfalse
enableAnimationWhether to enable text animation, supports p, li, h1, h2, h3, h4booleanfalse
animationConfigText animation configurationControllerUpdate{ from: { opacity: 0 }, to: { opacity: 1 }, config: { tension: 170, friction: 26 } }

ComponentProps

PropertyDescriptionTypeDefault
domNodeComponent ElementDomNode-
childrenContent wrapped in componentstring-
restComponent properties, supports standard HTML attributes (e.g. a(link) href, title) and custom attributesRecord<string,unknown>-
Basic Usage

Basic Markdown syntax rendering.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Streaming Rendering

Streaming conversation with Bubble.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Custom Components

Custom component rendering tags.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Plugin Usage

Rendering with plugins.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Custom Extension Plugin
CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
XSS Protection
CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code