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:

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:

html
<div class="codeblock">
  <div class="bar"><span class="lang">go</span>
    <button class="copy">copy</button></div>
  <pre>fmt.Println("hi")</pre>
</div>
go
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:

ClassComponentInjected by runtime?
.admAdmonition calloutsNo — authored
.ctabsContent tabsBehavior wired
.codeblockCode block + copy buttonBehavior wired
[data-filter]Live content filterBehavior wired
.page-metaOptional page header metadataRendered + validated
.cards / .cardLink card gridNo — authored
.tblReference tableNo — authored
.rvScroll-reveal animationBehavior wired
.sidebarSection navigationYes — generated
.pagetoc“On this page” railYes — generated
.search-modalGlobal search overlayYes — generated
.pnPrev / next footerYes — generated
.chart-frameChart containerNo — authored
No component matches — clear the filter to see all 13.

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.