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:
parent
ca94e9ccc1
commit
61f7e16491
1 changed files with 5 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue