Skip to content
MDX logoMDX v1.3.0
GitHub logo


Next.js provides an official plugin to simplify MDX importing into your project.

npm install --save @next/mdx @mdx-js/loader

To configure MDX, add the following to your next.config.js:

const withMDX = require('@next/mdx')()
module.exports = withMDX()

Use MDX for .md files

The Next.js MDX plugin allows for you to also use MDX parsing for .md files:

const withMDX = require('@next/mdx')({
extension: /\.mdx?$/
module.exports = withMDX({
pageExtensions: ['js', 'jsx', 'md', 'mdx']
Edit this page on GitHub
Getting Started