summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Georgey <geobro2310@gmail.com> 2022-10-24 23:52:34 +0530
committerGravatar GitHub <noreply@github.com> 2022-10-24 14:22:34 -0400
commit61f7e16491e97d0e396dfe25647d945d765fbb77 (patch)
treedd3c299a44b8ad8a25b890326df7d3c4718216e0
parentca94e9ccc14b6934a78f4b92ddd7ed8dc3b26560 (diff)
downloadastro-61f7e16491e97d0e396dfe25647d945d765fbb77.tar.gz
astro-61f7e16491e97d0e396dfe25647d945d765fbb77.tar.zst
astro-61f7e16491e97d0e396dfe25647d945d765fbb77.zip
Update README.md (#5179)
Hey there, so recently I was playing around the mdx, and wanted my users to navigate to a specific section in my article using the `id` tags. This was not happening when I was making custom components. When I pass the Astro props like above, the id was automatically getting passed for headings.
-rw-r--r--packages/integrations/mdx/README.md6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/integrations/mdx/README.md b/packages/integrations/mdx/README.md
index 57acc5c8c..0f287b44b 100644
--- a/packages/integrations/mdx/README.md
+++ b/packages/integrations/mdx/README.md
@@ -319,7 +319,11 @@ will be converted into this HTML:
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.
```astro title="src/components/Blockquote.astro"
-<blockquote class="bg-blue-50 p-4">
+---
+const props = Astro.props;
+---
+
+<blockquote {...props} class="bg-blue-50 p-4">
<span class="text-4xl text-blue-600 mb-2">“</span>
<slot />
</blockquote>