pahari
← All posts

Interactive posts with MDX

  • mdx
  • demo

This post is written in MDX, so it can mix Markdown with real components. The widget below is a Preact island — it ships no JavaScript until it scrolls into view, then hydrates and becomes interactive.

Clicks so far

3

Everything around it is still plain Markdown: lists, code, and links all work as usual.

Why this is nice

  • Content stays readable and easy to write.
  • Interactivity is opt-in and cheap — only islands hydrate.
  • You can drop real demos (charts, playgrounds, visualizations) right into a post.

Regular .md posts keep working too; reach for .mdx only when a post needs a component.