Skip to content
🎉MDX Conf — August 24th, 2020
MDX logo
v2.0.0-next.9

MDX Embed

With MDX Embed you can politely embed and load 3rd party media content such as Twitter, CodePen, CodeSandbox, Egghead Lessons, Gists and many more in your .mdx, no import required!

Install

npm install mdx-embed --save

Setup

Wrap your application with the MDXEmbedProvider to allow your .mdx to render all of the provided components

import React from 'react'
import {MDXEmbedProvider} from 'mdx-embed'

export default props => <MDXEmbedProvider>{props.children}</MDXEmbedProvider>

Usage

<!-- some-mdx-file.mdx -->

#### My cool pen

Here's a pen, and some other blog post text

<CodePen codePenId="PNaGbb" />

For the full installation and information about the various MDX packages visit the docs

Edit this page on GitHub