MDXRemote
Component
A React component that renders compiled MDX content.
Exported from nextra/mdx-remote
.
Props
Name | Type | Default |
---|---|---|
components | MDXComponents An object mapping names to React components. The key used will be the name accessible to MDX. | |
scope | Scope Pass-through variables for use in the MDX content. These variables will be available in the MDX scope. | |
compiledSource | string Raw 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' }}
/>