Using MDX


This theme comes with the @astrojs/mdx integration installed and configured in your astro.config.mjs config file. If you prefer not to use MDX, you can disable support by removing the integration from your config file.

Why MDX?

MDX is a special flavor of Markdown that supports embedded JavaScript & JSX syntax. This unlocks the ability to mix JavaScript and UI Components into your Markdown content for things like interactive charts or alerts.

If you have existing content authored in MDX, this integration will hopefully make migrating to Astro a breeze.

Example

Here is how you import and use a UI component inside of MDX.
When you open this page in the browser, you should see the clickable button below.

Embedded component in MDX

Tester
12/20/2024
Just testing
Teste
12/19/2024
123
xkcd
12/18/2024
Hello there
John Doe
12/15/2024
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad aut dignissimos eligendi hic laudantium neque ratione soluta unde veniam! Voluptate. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium adipisci, assumenda consequuntur cum dignissimos, ea esse harum neque nobis perspiciatis quidem quo sequi soluta veritatis voluptatibus? Asperiores delectus, dolor est facere incidunt mollitia nulla optio placeat, praesentium quidem quisquam quod quos sint temporibus unde ut voluptatum. At illum odio ratione!
rtrt
12/13/2024
is it working?
jjaimealeman
12/13/2024
Add comments to your Astro blog with AstroDB and Turso
Jay
12/13/2024
Hi from Turso Discord
Jay
12/13/2024
Hi from Turso Discord
Jay
12/13/2024
Hi from Turso Discord
Jay
12/13/2024
Is this CSRF protected?
Jay
12/13/2024
Hi from Turso Discord