MDXRemote Component
A React component that renders compiled MDX content.
Exported from nextra/mdx-remote.
Props
| Name | Type | Default |
|---|---|---|
components | MDXComponentsAn object mapping names to React components. The key used will be the name accessible to MDX. | |
scope | ScopePass-through variables for use in the MDX content. These variables will be available in the MDX scope. | |
compiledSource | stringRaw JavaScript compiled MDX source code, a result of Nextra’s
|
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' }}
/>