
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
More Links
- MDX Syntax Documentation
- Astro Usage Documentation
- Note: Client Directives are still required to create interactive components. Otherwise, all components in your MDX will render as static HTML (no JavaScript) by default.
MercuryZz
3/21/2025
hello Niko
Double submit after refresh
3/15/2025
does this still submit a comment after refresh
Double submit after refresh
3/15/2025
does this still submit a comment after refresh
Kire Zdraveski
3/1/2025
hello
Kire Zdraveski
3/1/2025
hello
dennis
2/5/2025
Test
Test
2/2/2025
Hello
asd
2/2/2025
test!!
Lee Hwak Lyom
1/28/2025
Wssup
Oscar
1/15/2025
sdgdf
Oscar
1/15/2025
sdvasdgdsgasd
rokma
1/7/2025
wow, amazing, so fast.
I am sold.
yokko
1/7/2025
yokodude
Me
1/4/2025
Ttt
asd
1/2/2025
asd
fgsdgfdfg
12/28/2024
dsfgsdfg
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