Back to overview

Exploring MDX – Markdown Syntax Meets JSX

September 5th, 20231 min read

If you're a developer or a content creator who frequently works with Markdown, you might have heard of MDX. MDX is a powerful way to combine Markdown syntax with JSX (JavaScript XML).

Markdown and JSX: A brief Refresher

Markdown is a lightweight markup language that is easy to write and read. It's commonly used for creating text-based content like blog posts or documentation.

Check out the official Markdown Documentation to get started.

The basic syntax looks like this:

To generate a heading, simply prefix a word or phrase with number signs (#). The quantity of number signs you employ should match the desired heading level. For instance, to produce a heading at level three <h3>, employ three number signs (e.g., ### Heading Level 3).

### Heading Level 3

Heading Level 3

You can also combine different syntax to generate a blockquote with formatted text.

> This is some **bold** text.

This is some bold text.

JSX is a syntax extension for JavaScript, often associated with React. It allows you to write HTML-like code within your JavaScript, making it easy to build dynamic and interactive user interfaces.

The Power of MDX

MDX combines the best of both worlds. With MDX, you can seamlessly embed JSX components and code blocks within your Markdown documents.

Hey look a button: