astro/docs/reference/builtin-components.md

33 lines
920 B
Markdown
Raw Permalink Normal View History

2021-06-28 06:27:12 +00:00
---
layout: ~/layouts/Main.astro
title: Astro Builtin Components
---
Astro includes several builtin components for you to use in your projects. All builtin components are available via `import {} from 'astro/components';`.
## `<Markdown />`
```astro
---
import { Markdown } from 'astro/components';
---
<Markdown>
# Markdown syntax is now supported! **Yay!**
</Markdown>
```
See our [Markdown Guide](/docs/guides/markdown-content.md) for more info.
2021-07-07 20:10:09 +00:00
<!-- TODO: We should move some of the specific component info here. -->
2021-06-28 06:27:12 +00:00
## `<Prism />`
```astro
---
import { Prism } from 'astro/components';
---
<Prism code={`const foo = 'bar';`} />
```
This component provides syntax highlighting for code blocks. Since this never changes in the client it makes sense to use an Astro component (it's equally reasonable to use a framework component for this kind of thing; Astro is server-only by default for all frameworks!).