Power of MDX with Code and Components
2025-05-18
The Power of MDX
MDX allows you to write Markdown and use React components in the same file. This gives you the ability to mix prose with interactive UI.
π‘ Callout: Embedded Component
Letβs render a custom component here:
MDX + React FTW
You can embed any React component inside MDX.
π§βπ» Syntax Highlighting with Shiki
With rehype-pretty-code
, you get beautifully themed VS Code-style syntax highlighting:
type Props = { name: string }
export default function Hello({ name }: Props) {
return <p>Hello, {name}!</p>
}