Skip to main content

Customizing Components

使用MDX,您可以用自定义实现替换Markdown呈现的每个HTML元素. 这样,您可以在渲染时使用一组设计系统组件.

可以使用MDXProvider自定义以下组件:

TagNameSyntax
pParagraph
h1Heading 1#
h2Heading 2##
h3Heading 3###
h4Heading 4####
h5Heading 5#####
h6Heading 6######
thematicBreakThematic break***
blockquoteBlockquote>
ulList-
olOrdered list1.
liList item
tableTable--- \| --- \| --- \| ---
trTable rowThis \| is \| a \| table row
td/thTable cell
prePre```js console.log()```
codeCode`console.log()`
emEmphasis_emphasis_
strongStrong**strong**
deleteDelete~~strikethrough~~
codeInlineCode`console.log()`
hrBreak---
aLink<https://mdxjs.com> or [MDX](https://mdxjs.com)
imgImage![alt](https://mdx-logo.now.sh)

How does this work?

传递给MDXProvider的组件用于呈现Markdown创建的HTML元素. 它使用React的Context API .


Edit this page on GitHub
Docs
Tutorials
Plugins
Blog
Showcase

by  ICOPY.SITE