DocsBlogChangelog

MDXContent

Server Only

Compiles and renders a string of MDX content.

Security

Always sanitize user-provided content before passing it to MDXContent. This includes sanitizing value, components, and dependencies.

Failing to do so puts you at risk of a cross-site scripting (XSS) attack. See the MDX security documentation for more information.

Examples

Hello World

Basic

API Reference

MDXContent

View Source

value *

string

The MDX content to render.

components

MDXComponents

Additional components to use or a function that creates them.

dependencies

Record<string, any>

An object of external dependencies that will be available to the MDX source code.

remarkPlugins

CompileOptions['remarkPlugins']

Remark plugins to use. See PluggableList for more info.

rehypePlugins

CompileOptions['rehypePlugins']

Rehype plugins to use. See PluggableList for more info.

baseUrl

string

Base URL to resolve imports and named exports from (e.g. import.meta.url)

Last updated