MDX Example
This post demonstrates MDX capabilities with custom components
Exploring MDX in Keystatic
This is an example of using MDX in a Keystatic project. MDX allows you to use JSX components within your markdown content.
Basic Markdown Features
You can use all the standard markdown features like:
- Lists
- Bold text
- Italic text
- Links
Code Blocks
Using Custom Components
Below is an example of a custom React component used within MDX:
This is an info box component rendered within your MDX content.
It can contain markdown formatting and multiple paragraphs.
Be careful when working with custom components!
You’ve successfully integrated MDX with Keystatic!
Something went wrong. Please check your configuration.
function getHeadings() { return [ { depth: 2, slug: 'basic-markdown-features', text: 'Basic Markdown Features' }, { depth: 2, slug: 'code-blocks', text: 'Code Blocks' }, { depth: 2, slug: 'using-custom-components', text: 'Using Custom Components' }, { depth: 2, slug: 'advantages-of-mdx', text: 'Advantages of MDX' }, ]; }
Advantages of MDX
- Component Reuse - Create and reuse UI components within your content
- Dynamic Content - Generate content dynamically with JavaScript
- Rich Interactivity - Add interactive elements to your documentation
- Full Markdown Support - Maintain all the benefits of standard markdown
That’s it! Now you have a powerful content authoring system that combines the simplicity of markdown with the power of React components.