Core concepts

Components

Experimentalv0.4.0-rc
Version links
Currentv0.4.0-rcChangelogv0.4.0-rc

Doc components express semantics such as notes, diffs, structured blocks, and columns. Most components can be used as MDX tags or Markdown directives.

If you mainly need a syntax cheat sheet instead of rendered examples, go straight to Authoring Syntax.

Callout

Callouts should reflect intent:

  • Tip/Note: neutral white block for light hints or clarifications.
  • Info: blue block for stable info or consistency notes.
  • Warning: orange block for risks or hard constraints.
  • Deprecated: red block for deprecations and migration notices.
Tip

Use for hints and small reminders.

Info

Use for stable rules or consistency notes.

Warning

Use for risk or hard constraints.

Deprecated

Use to mark deprecated features or migration notices.

Alerts (GitHub syntax)

Use GitHub-style alerts in Markdown and they will map to callouts automatically.

Note

This maps to the Note callout and keeps migration syntax consistent.

Warning

Use for risks or hard constraints.

Columns

Side by side

Good for pairing concepts or steps.

Structured comparison

Helps readers quickly understand differences.

Cards

Use cards to surface key entry points, landing sections, or recommended reading. The grid defaults to four columns and collapses to two on mobile.

Cards (directive)

Start Quickstart Browse components Read changelog

Badges

Beta Stable Caution

Inline syntax: Experimental.

Math Equations

Inline math uses $...$. Block math uses $$...$$ and renders with KaTeX.

Inline example: E=mc2E = mc^2.

01x2dx=13\int_0^1 x^2 \, dx = \frac{1}{3}

Diff Block

Use to compare two approaches side by side. beforeLabel and afterLabel are optional when you want the top labels.

Old behaviorNew behavior
cache: "manual"

Cache strategy maintained by hand.

cache: "filesystem"

Automatically synced with the file structure.

Code Block

Use standard Markdown code fences. The renderer adds the shared code styling and copy action.

ts
export const navStrategy = "filesystem";
export const contentPath = "content";

Colored Diffs

Lines starting with + or - in code blocks are rendered with diff backgrounds for upgrade guides.

diff
- cache: "manual"
+ cache: "filesystem"

Code Tabs

Switch between multiple snippets inside one block. Use the code-group directive without extra JSX.

Structured Outputs
javascript
const completion = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "Jane, 54 years old" }],
});
Structured Outputs
javascript
const response = await openai.responses.create({
  model: "gpt-5",
  input: "Jane, 54 years old",
});

Rich panels

For mixed content (text, images, blocks), use :::code-group with :::tab panels.

Use tabs for notes, prose, or images alongside code.

Config

toml
[docs]
static = true

:::

Steps

Turn ordered lists into step-by-step flows for long procedures.

  1. Install the typematter dependencies.

  2. Update the content/ directory structure.

  3. Run npm run validate:docs before building.

File Tree

Render Markdown lists as a file tree with collapsible folders.

  • app
    • layout.tsx
    • page.tsx
  • content
    • core-concepts
      • components.mdx
  • package.jsonProject metadata

Details / Accordion

Use collapsible blocks for supporting or optional content.

Why this matters

This keeps long explanations out of the main reading flow.

Annotations

Inline annotations add contextual tooltips that still support Markdown.

This API is experimental Heads upSee the migration guide for constraints..

Feature Matrix

Compare multiple offerings with a semantic Markdown table.

CapabilitiesChat Completions APIResponses API
Text generation
Audiocoming soon
Vision
Structured Outputs
Function calling
Web search
File search
Computer use
Code interpreter
MCP
Image generation
Reasoning summaries

Endpoint / ParamTable / ResponseSchema

Use this set for API reference pages. The goal is to split endpoint header, parameters, and response structure into stable semantic blocks instead of loose prose and ad-hoc tables.

GET/v1/docs/[slug]
Fetch a doc page

Returns registry metadata for a route.

Auth: optionalSince 0.4.0-rc
Path params
NameTypeRequiredDefaultDescription
slug
string[]
Yes
-

Route segments for the document.

lang
"cn" | "en"
No
cn

Language code.

200 Response
HTTP 200application/json
titlestringrequired
Page title
sectionstringrequired
Section name
tocTocItem[]
Structured headings
idstringrequired
Anchor id
titlestringrequired
Heading text
levelnumberrequired
Heading depth

Directive syntax

mdx
:::endpoint{method="GET" path="/v1/docs/[slug]" title="Fetch a doc page" summary="Returns registry metadata for a route." auth="optional" since="0.4.0-rc"}:::param-table[Path params]::param-field[slug]{type="string[]" required="true" description="Route segments for the document."}::param-field[lang]{type='"cn" | "en"' default="cn" description="Language code."}::::::response-schema[200 Response]{code="200" mediaType="application/json"}::schema-field[title]{type="string" required="true" description="Page title"}::schema-field[section]{type="string" required="true" description="Section name"}:::schema-field[toc]{type="TocItem[]" description="Structured headings"}::schema-field[id]{type="string" required="true" description="Anchor id"}::schema-field[title]{type="string" required="true" description="Heading text"}::schema-field[level]{type="number" required="true" description="Heading depth"}:::::::::

DoDont

This is useful for best practices, migration rules, and review checklists where "do this / don't do this" is the core message.

When writing API docs
Do
Don't

Directive syntax

mdx
:::do-dont[When writing API docs]:::do[Keep fields stable]Public field names, enum values, and error codes should stay stable over time.::::::dont[Do not rely on examples alone]Example responses do not replace field-level structure.::::::

VersionGate

Use this to make it obvious when a capability was introduced, deprecated, or removed.

Legacy search index
Since 0.2.0Deprecated 0.4.0Removed 1.0.0

When a feature enters migration mode, do not just say "this may change later". Put the version policy next to the feature itself.

Directive syntax

mdx
:::version-gate[Legacy search index]{since="0.2.0" deprecated="0.4.0" removedIn="1.0.0" replacement="standard search manifest"}When a feature enters migration mode, do not just say "this may change later". Put the version policy next to the feature itself.:::

CommandGroup

Use it to switch commands by package manager, operating system, or environment.

Install Typematter
Recommended
pnpm install
pnpm dev
npm install
npm run dev
yarn
yarn dev
bun install
bun run dev

Directive syntax

mdx
:::command-group[Install Typematter]:::command[pnpm]{description="Recommended"}```bashpnpm installpnpm dev```::::::command[npm]```bashnpm installnpm run dev```::::::

PreviewFrame

Use this for screenshots, recordings, product demos, or same-origin iframe previews.

Quickstart page preview
Open source
Good for same-origin page previews. You can also pass an image or video source.

Directive syntax

mdx
::preview-frame[Quickstart page preview]{src="/en/get-started/quickstart/" caption="Good for same-origin page previews. You can also pass an image or video source."}

Timeline / ReleaseItem

Use it for version history, migration stages, and breaking change narratives.

0.1.0Initial shell
2026-01-26

Introduced the static docs shell, MDX loading, and base navigation.

0.2.0Search and Ask AI
2026-02-03Beta

Added standard search assets and optional Ask AI integration.

0.4.0-rcVersioning and localized search
2026-03-20Current

Added version links, document-type templates, richer Chinese search aliases, and improved Ask AI retrieval.

Directive syntax

mdx
:::timeline:::release-item[Initial shell]{version="0.1.0" date="2026-01-26"}Introduced the static docs shell, MDX loading, and base navigation.::::::release-item[Versioning and localized search]{version="0.4.0-rc" date="2026-03-20" status="Current"}Added version links, document-type templates, richer Chinese search aliases, and improved Ask AI retrieval.::::::