MDX
默认 MDX 组件
用法
默认 MDX 组件包括卡片、标注、代码块和标题。
import defaultMdxComponents from 'fumadocs-ui/mdx';相关链接
要支持 href 中相对文件路径的链接,请使用以下命令覆盖默认的 a 组件:
import { createRelativeLink } from 'fumadocs-ui/mdx';
import { source } from '@/lib/source';
const page = source.getPage(['...']);
return (
<MdxContent
components={{
// override the `a` tag
a: createRelativeLink(source, page),
}}
/>
);[My Link](./file.mdx)示例:../(integrations)/open-graph.mdx
Server Component only.
AI Magic 3D文档