Skip to main content
the setups

Framework Integration

App Router (@next/mdx):

// next.config.mjs
import createMDX from '@next/mdx';
import remarkNotes from 'remark-notes-plugin';

const withMDX = createMDX({
options: { remarkPlugins: [remarkNotes] },
});

export default withMDX({
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
});

Pages Router:

// next.config.js
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
options: { remarkPlugins: [require('remark-notes-plugin')] },
});

module.exports = withMDX({
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'],
});

Processing markdown programmatically (e.g. getStaticProps) works the same as the Vanilla unified/remark tab.

Configuration best practices​

Disable style injection (injectStyles: false) when a build tool already handles your CSS imports, you're doing SSR with separate CSS extraction, or you're providing your own styles.

Use classPrefix when the default remark-note classes would collide with something else in your CSS, or you're running the plugin more than once with different styling.

See Customization for CSS overrides, or Troubleshooting if something isn't working.