Using Markdown Syntax in Docusaurus Documentation
Docusaurus supports using Markdown as the primary content authoring format and compiles Markdown files into React components via the MDX compiler. This article introduces commonly used Markdown syntax and its usage in Docusaurus.
1. Headingsâ
Use #
for a first-level heading, ##
for a second-level heading, and so on.
# First-level heading
## Second-level heading
### Third-level heading
2. Emphasisâ
- Bold:
**bold**
or__bold__
- Italic:
*italic*
or_italic_
3. Links and Imagesâ
- Link:
[Docusaurus Official Site](https://docusaurus.io/)
- Image:

4. Code Blocksâ
Wrap code with triple backticks. You can specify the language for syntax highlighting:
```js
console.log('Hello, Docusaurus!');
```
Demo:
console.log('Hello, Docusaurus!');
5. Blockquotesâ
Use >
for blockquotes:
> This is a blockquote.
Demo:
This is a blockquote.
6. Detailsâ
Docusaurus supports embedding HTML elements like <details>
, with beautiful styles:
<details>
<summary>Click to expand</summary>
Here is the detailed content, which can include **Markdown** syntax.
</details>
Demo:
Details
Click to expand
Here is the detailed content, which can include Markdown syntax.7. Front Matterâ
Each Markdown file can have metadata at the top, wrapped in three dashes, using YAML format:
---
title: Document Title
description: This is the document description
---
8. MDX vs. CommonMarkâ
- Docusaurus v3 uses the MDX parser for all
.md
and.mdx
files by default, allowing you to embed React components directly in Markdown. - To use standard CommonMark, set
markdown.format: 'detect'
indocusaurus.config.js
..md
files will be parsed with CommonMark,.mdx
with MDX. - See the official documentation for details.
9. Admonitionsâ
:::note
Content
:::
# Other available types
[note/tip/info/warning/danger]
Some content with Markdown syntax
. Check this api
.
Some content with Markdown syntax
. Check this api
.
Some content with Markdown syntax
. Check this api
.
Some content with Markdown syntax
. Check this api
.
Some content with Markdown syntax
. Check this api
.
10. Docusaurus-Specific Featuresâ
- Supports Tabs, Admonitions, Math Equations, and other extended syntax.
- You can directly insert React components into documents via MDX.
11. Referencesâ
To experiment with MDX syntax, use the MDX Playground.