Robinson shows a TypeScript Next.js config that adds .mdx to the supported page extensions and uses the @next/mdx plugin. He also mentions an experimental Rust compiler that may speed up builds when statically prerendering many MDX pages. The example includes the MDX loader, React, and type dependencies.
MDX with Next.js App Router
Speaker
Lee Robinson, whose role and company are not stated, explains how to use MDX with Next.js App Router, using his leerob.com portfolio as the example.
A root-level mdx-components.tsx file maps Markdown elements such as headings, links, code, tables, and quotes to React components. Robinson styles typography with Tailwind and routes internal links through Next.js Link for prefetching. Once defined, these components are available to MDX pages without importing them individually.
With .mdx enabled, app/page.mdx can serve as the application’s home route. Robinson mixes Markdown with a server component that uses CSS for a hover animation, and explains that App Router recognizes files such as Open Graph images and favicons for metadata. A root layout adds metadata and a view transitions provider.
File-system routes such as n/devrel/page.mdx use the shared typography components while supporting locally imported React components and page metadata, including a title and canonical link. A more complex post imports local components, a static image, and Next.js Image, and also uses HTML details elements and footnotes. Robinson notes that files can be colocated in the App Router without becoming routes.
Robinson recommends the Next.js Markdown and MDX documentation for Remark or Rehype plugins and guidance on remote MDX. The demonstrated setup focuses on local files and uses a small set of MDX and React dependencies. He also notes that the site can combine static and dynamic content and use Next.js image optimization.
Takeaways
- Put shared MDX renderers in mdx-components.tsx to keep typography and behavior consistent across pages.
- Use MDX page files as App Router routes when content lives in the project repository.
- Import React components locally when a post needs custom interactive or animated content.
- Use Next.js Link for internal links to enable page prefetching.
- Consider the experimental Rust MDX compiler if static prerendering many pages dominates build time.
Mentioned in this talk
Search inside this talk
What was claimed 11
- usesleerob.com uses Markdown
“That’s the template we’re going to be looking at today.”
YouTube Unverified1 source· Talk
- usesleerob.com uses
Next.js
“how I built my Next.js site”
YouTube Unverified1 source· Talk
- builtLee Robinson built leerob.com
“my Next.js site”
YouTube Unverified1 source· Talk
- feature
Next.js: Next.js 15 supports a TypeScript config file and MDX page extensions
“With Next.js 15, you can now use a .ts file to support TypeScript.”
YouTube Unverified1 source· Talk
- usesleerob.com uses Turbopack
“I’m also using Turbopack”
YouTube Unverified1 source· Talk
- usesleerob.com uses
Postgres
“reading from Postgres”
YouTube Unverified1 source· Talk
- usesleerob.com uses Tailwind CSSv4 beta
“I’m using the Tailwind CSS v4 beta”
YouTube Unverified1 source· Talk
- featureApp Router: Top-level Open Graph image and favicon files in the app directory automatically provide metadata
“if there’s a top-level Open Graph image file, it will automatically use that”
YouTube Unverified1 source· Talk
Related talks
14:29
1:21:37
50:44
16:46
4:21
59:53
