You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add custom components to mdx integration guide (#4530)
* Add custom components to mdx integration guide
* Update packages/integrations/mdx/README.md
Co-authored-by: Ben Holmes <[email protected]>
* Update packages/integrations/mdx/README.md
Co-authored-by: Ben Holmes <[email protected]>
* Update packages/integrations/mdx/README.md
Co-authored-by: Ben Holmes <[email protected]>
* Update packages/integrations/mdx/README.md
Co-authored-by: Ben Holmes <[email protected]>
* Incorporate Sarah and Ben's Feedback
* Fix what would be an ugly background lol
* Sarah taking liberty of removing double text
* Add changeset
Co-authored-by: Ben Holmes <[email protected]>
Co-authored-by: Sarah Rainsberger <[email protected]>
Under the hood, MDX will convert Markdown into HTML components. For example, this blockquote:
255
+
256
+
```md
257
+
> A blockquote with *some* emphasis.
258
+
```
259
+
260
+
will be converted into this HTML:
261
+
262
+
```html
263
+
<blockquote>
264
+
<p>A blockquote with <em>some</em> emphasis.</p>
265
+
</blockquote>
266
+
```
267
+
268
+
But what if you want to specify your own markup for these blockquotes? In the above example, you could create a custom `<Blockquote />` component (in any language) that either has a `<slot />` component or accepts a `children` prop.
Now, writing the standard Markdown blockquote syntax (`>`) will use your custom `<Blockquote />` component instead. No need to use a component in Markdown, or write a remark/rehype plugin! Visit the [MDX website](https://mdxjs.com/table-of-components/) for a full list of HTML elements that can be overwritten as custom components.
285
+
286
+
287
+
#### Custom components with imported `mdx`
288
+
289
+
When rendering imported MDX content, custom components can also be passed via the `components` prop:
0 commit comments