Guide
Writing pages
The component vocabulary — everything mkdocs-material gives you via extensions, expressed as plain HTML classes. Each example below is rendered live.
Page structure
Author only what is unique to your page. The runtime injects everything else:
- You write:
<main class="doc">with headings, prose, components. - Injected: header, sidebar drawer, search overlay, “on this page” rail (from your
h2/h3 ids), ¶ anchors, prev/next, footer, back-to-top.
Admonitions
Three levels, same shape as mkdocs-material’s !!! note blocks:
Note
<div class="adm note"> — neutral context and cross-references.
Tip
<div class="adm tip"> — shortcuts and best practice.
Warning
<div class="adm warn"> — breaking changes and sharp edges.
Tabs & code blocks
Content tabs for platform-specific instructions; code blocks get a language label and a copy button wired automatically:
<div class="codeblock"> <div class="bar"><span class="lang">go</span> <button class="copy">copy</button></div> <pre>fmt.Println("hi")</pre> </div>
fmt.Println("hi")
Filtering page content — live
The headline feature. Put data-filter="#target" on any input and every child of the
target becomes filterable by its text and data-tags. Try it on the component reference:
| Class | Component | Injected by runtime? |
|---|---|---|
.adm | Admonition callouts | No — authored |
.ctabs | Content tabs | Behavior wired |
.codeblock | Code block + copy button | Behavior wired |
[data-filter] | Live content filter | Behavior wired |
.page-meta | Optional page header metadata | Rendered + validated |
.cards / .card | Link card grid | No — authored |
.tbl | Reference table | No — authored |
.rv | Scroll-reveal animation | Behavior wired |
.sidebar | Section navigation | Yes — generated |
.pagetoc | “On this page” rail | Yes — generated |
.search-modal | Global search overlay | Yes — generated |
.pn | Prev / next footer | Yes — generated |
.chart-frame | Chart container | No — authored |
Note — filter vs. search
Filter narrows what is on this page (like mkdocs-material’s tag filtering).
Search (Ctrl K) looks across every page via the index in
toc.js. Same matcher, different scope.