Skip to content
ironmark

Astro

ironmark/astro is an Astro integration. It needs @astrojs/react or @astrojs/preact.

// astro.config.mjs
import react from "@astrojs/react";
import ironmark from "ironmark/astro";
 
export default {
  integrations: [react(), ironmark()],
};

.mdx files become React (or Preact) components that .astro pages render like any other framework component:

---
import Guide from "../content/guide.mdx";
import Note from "../components/Note.jsx";
---
 
<Guide components={{ Note }} />

The integration picks jsxImportSource from @astrojs/react or @astrojs/preact. Pass jsxImportSource yourself to override it.

Astro handles .md files itself, so the integration only claims .mdx by default. To import .md files as components with exported html and headings, widen include to a folder Astro does not render as pages, for example include: /\/content\/.*\.mdx?$/.

See options for everything the integration accepts.