Skip to content

Pages and frontmatter

Write a page as an MDX file, list it in docs.json, and set how it looks with frontmatter.

2 min read

Updated

A page is one .md or .mdx file in your docs folder. It goes on your site when you list it in docs.json.

Each entry in a group’s pages is a file path from the docs folder, with no extension:

docs.json
{
"navigation": {
"tabs": [
{
"tab": "Documentation",
"groups": [
{
"group": "Get started",
"pages": ["introduction", "guides/install"]
}
]
}
]
}
}

guides/install is the file guides/install.mdx. The order of the list is the order in the sidebar. A file that no group lists isn’t published.

Frontmatter is a block of YAML at the top of the file:

guides/install.mdx
---
title: "Install"
description: "Add the package to your project."
icon: "download"
---
Your content starts here.
titlestringpath

The page’s title. Without one, Specly uses the file name: rate-limits.mdx becomes “Rate limits”.

descriptionstringpath

One sentence, shown under the title. It also describes the page in search results and when the link is shared.

sidebarTitlestringpath

A shorter name for the sidebar, when the title is long.

iconstringpath

An icon beside the page in the sidebar, by its Lucide name.

modestringpathdefault: default

The page’s layout: default, wide, center, frame or custom. See below.

tutorialbooleanpath

Adds a Done box to every step, a progress bar and a finish panel. See Tutorials with progress.

nextstring | string[]path

The pages a finished tutorial offers next, as paths from the docs folder. Without it, the tutorial offers the next page in the same tab.

rssbooleanpath

Makes the page a changelog with an RSS feed, before its first <Update>. See Changelog with RSS.

openapistringpath

Makes the page an endpoint from an OpenAPI file, such as "GET /users".

apistringpath

Makes the page a hand-written endpoint, such as "GET /users", with the page’s own text as its description.

playgroundstringpath

How this endpoint page’s Try it shows: interactive, simple or none.

mode changes what surrounds the page’s content.

Mode Sidebar Right column Title Content width
default Yes Yes Yes Reading width
wide Yes No Yes Reading width
center No No Yes Reading width
frame Yes No No Full
custom No No No Full

The right column holds the page’s actions, its contents (On this page) and its margin notes. With custom, the page owns everything between the header and the footer.

MDX
---
title: "Compare plans"
mode: "wide"
---
Was this page helpful?

Report a problem

What’s the problem?

The docs team sees this. Other readers don’t.