Page template
To start a new page:
cp content/template.mdx content/my-page.mdx- Edit the front matter at the top —
titlesets the sidebar label and browser title,descriptionsets the meta description. - Delete the sections below that you don’t need.
- Add
'my-page'to the_meta.tsin the same folder to place it in the sidebar.
Use .mdx for pages with components, .md for plain Markdown. The rest of this
page shows what is available.
Headings become the table of contents
## and ### headings appear in the “On This Page” panel on the right.
Keep to one # per page.
A third-level heading
Regular paragraphs, bold, italic, inline code, and
links . Prefer absolute links to other docs pages
(/some/page) so they survive a file move.
Callouts
Code blocks
Give every block a language. Optionally add a file name and highlight lines:
const job = await getJob(jobId)
await job.run() // this line is highlightednpm run devSteps
Do the first thing
Headings inside <Steps> are numbered automatically.
Then the second
Each heading advances the counter.
Tabs
npm
npm installTables
| Column | Meaning |
|---|---|
foo | What foo is for |
bar | What bar is for |
Lists
- A bullet
- Another bullet
- A nested one
- A numbered step
- The next one
Cards
File tree
- _meta.ts
- index.mdx
Images
Put images in public/ and reference them from the site root, e.g.
.
Other components
Bleed, Mermaid, ImageZoom, Collapse and Playground are also available
from nextra/components. See the
Nextra component reference .
To use a component on every page without importing it, register it in
mdx-components.tsx at the repo root.