0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

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.
This commit is contained in:
Georgey 2022-10-24 23:52:34 +05:30 committed by GitHub
parent ca94e9ccc1
commit 61f7e16491
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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>