#passing components to <Content />
3 messages · Page 1 of 1 (latest)
Hi @fresh grove. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
You are correct: passing components to the <Content /> component using the components prop (e.g., <Content components={{ a: ExternalLink }} />) is a feature specific to MDX files, not standard Markdown (.md) files.
The knowledge sources confirm that MDX supports mapping HTML elements to custom components via the components prop when rendering imported MDX content. This allows you to override elements like <a> with your own components (such as ExternalLink). This is not mentioned as being available for .md files—only for .mdx files using the MDX integration. Standard Markdown files do not support this kind of component mapping or JSX expressions, and the feature is not documented for .md files in Astro. In fact, with the removal of Astro-Flavored Markdown in v2, importing and using components in .md files is no longer supported at all; you must use MDX for this functionality Using Components in MDX Upgrade to Astro v2.