HighlightCode
HighlightCode
When you need to render highlighted code blocks in Markdown.
| Property | Description | Type | Default |
|---|---|---|---|
| lang | Language | string | - |
| children | Code content | string | - |
| header | Header section | React.ReactNode | null | React.ReactNode |
| className | Style class name | string | |
| classNames | Style class names | string | - |
| highlightProps | Code highlighting configuration | highlightProps | - |
| Token Name | Description | Type | Default Value |
|---|---|---|---|
| colorBgTitle | Title background color | string | rgba(0,0,0,0.06) |
| colorBorderCode | Code block border color | string | #f0f0f0 |
| colorTextTitle | Title text color | string | rgba(0,0,0,0.88) |
import React from 'react';
import { XMarkdown } from '@ant-design/x-markdown';
const App = () => <XMarkdown content='Hello World' />;
export default App;