Skip to Content
🎉 Nextra 4.0 is released. dimaMachina is looking for a new job or consulting .

MDXRemote Component

A React component that renders compiled MDX content.

Exported from nextra/mdx-remote.

Props

NameTypeDefault
componentsMDXComponents

An object mapping names to React components. The key used will be the name accessible to MDX.

scopeScope

Pass-through variables for use in the MDX content. These variables will be available in the MDX scope.

compiledSourcestring

Raw JavaScript compiled MDX source code, a result of Nextra’s compileMdx function.

Example

example.mdx
import { compileMdx } from 'nextra/compile' import { MDXRemote } from 'nextra/mdx-remote' <MDXRemote compiledSource={await compileMdx('# Hello {myVariable} <MyComponent />')} components={{ MyComponent: () => <div>My Component</div> }} scope={{ myVariable: 'World' }} />