Code group
Display multiple code blocks with tabbed navigation.
Use the CodeGroup component to show multiple related code blocks in a single tabbed container. This is useful for showing the same command or snippet across different languages or tools.
Wrap two or more fenced code blocks inside <CodeGroup>. Each tab is labeled from the title attribute on the code block:
<CodeGroup>
```bash title="npm"
npm install blodemd
```
```bash title="pnpm"
pnpm add blodemd
```
```bash title="yarn"
yarn add blodemd
```
</CodeGroup>npm install blodemdpnpm add blodemdyarn add blodemdShow the same API call in different programming languages:
<CodeGroup>
```javascript title="Node.js"
const res = await fetch("https://api.blode.md/v1/projects", {
headers: { Authorization: `Bearer ${API_KEY}` },
});
const data = await res.json();
```
```python title="Python"
import requests
res = requests.get(
"https://api.blode.md/v1/projects",
const res = await fetch("https://api.blode.md/v1/projects", {
headers: { Authorization: `Bearer ${API_KEY}` },
});
const data = await res.json();Tabs are labeled in this order of priority:
title attribute on the code fence (e.g., ```bash title="npm")javascript, python)Always set explicit title attributes when the language alone does not
distinguish the tabs.