Tabs
Organize related content into switchable panels.
Basic Usage
Content for the first tab.
With Icons
Add Phosphor icons before tab labels:
Run commands in your terminal.
With Code Blocks
Tabs containing code blocks automatically display language icons:
function greet(name) {
return `Hello, ${name}!`;
}
Platform Instructions
Combine icons with code for platform-specific content:
brew install docyard
Synced Tabs
Tabs with identical labels stay in sync across the page. Click “Python” in either group and both switch together:
const x = 1;
console.log(x);
Your preference is saved and persists across page loads.
Keyboard Navigation
| Key | Action |
|---|---|
Arrow Left / Arrow Right |
Switch between tabs |
Home |
Jump to first tab |
End |
Jump to last tab |
Syntax
:::tabs
== Tab Label
Content for this tab.
== Another Tab
More content here.
:::
With icons:
:::tabs
== :icon-name: Tab Label
Content here.
:::
Reference
| Feature | Syntax | Description |
|---|---|---|
| Container | :::tabs |
Required. Wraps all tabs |
| Tab | == Label |
Required. Creates a new tab |
| Icon | == :icon: Label |
Optional. Phosphor icon before label |
| Content | Markdown | Any Markdown content after the label |
| Behavior | Description |
|---|---|
| Auto icons | Code blocks auto-detect language icons |
| Synced tabs | Same labels sync across page |
| Persistence | Selected tab saved to localStorage |
Edit this page
Last updated
Was this page helpful?
Thanks for your feedback!