This is my first Markdown file written in "new" Astro... so let's see some of those components in markdown we've all been waiting for!

Hello Astro v0.21.0 - Components in Markdown!

astro
markdown

Written by: Sarah on 2021-11-22

One of the features weā€™ve all been waiting for in the Astro rewrite has been components in Markdown! šŸ„³

Hereā€™s a React Counter componentā€¦

0

And hereā€™s another React componentā€¦

Get a list of recently-observed birds in your area!

Current location set:

Reported in the last 14 days...

And hereā€™s the code for this pageā€¦

Note how we import components via setup at the top of the Markdown pageā€™s front matter, but then everything else is just as youā€™d expect in Markdown:

---
setup: |
    import ReactCounter from '../../components/ReactCounter.jsx'
    import BirdFetchComponent from '../../components/experiments/BirdFetchComponent.jsx'

title: Hello Astro v0.21.0 - Components in Markdown!
author: Sarah
date: 2021-11-22
description: This is my first Markdown file written in "new" Astro... so let's see some of those components in markdown we've all been waiting for!
layout: ../../layouts/MarkdownPostLayout.astro
---
One of the features we've all been waiting for in the Astro rewrite has been components in Markdown! šŸ„³

## Here's a React Counter component...

<ReactCounter client:load/>

## And here's another React component...

<BirdFetchComponent client:load/>
astro
markdown

See more posts ...