Purpose: This file provides context for AI agents in the parent application to understand how to write and format documentation pages for Null MDX. This is a reference guide for content creation, MDX component usage, and best practices.
- File Structure
- Frontmatter Schema
- Supported MDX Components
- Markdown Formatting
- Code Blocks
- Best Practices
- Common Patterns
Documentation content is organized in the content/ directory:
content/
├── docs/ # Documentation pages
│ ├── introduction.mdx
│ ├── installation.mdx
│ ├── getting-started.mdx
│ ├── api.mdx
│ └── guides/ # Nested guides
│ ├── configuration.mdx
│ └── writing-content.mdx
└── blog/ # Blog posts
├── hello-world.mdx
└── tech-stack-2025.mdx
- Use kebab-case for file names:
getting-started.mdx,api-reference.mdx - File names become URL slugs:
installation.mdx→/docs/installation - Nested folders create nested routes:
guides/configuration.mdx→/docs/guides/configuration
Every MDX file must begin with YAML frontmatter wrapped in --- delimiters.
---
title: "Page Title" # Required - Display title (also used for SEO)
description: "Brief summary" # Required - Used in meta tags and page previews
order: 1 # Optional - Controls sidebar ordering (lower = higher)
------
title: "Blog Post Title" # Required
description: "Post summary" # Required
date: "2025-01-03" # Required - ISO date format YYYY-MM-DD
author: "Author Name" # Optional
tags: ["tag1", "tag2"] # Optional - Array of tags
draft: false # Optional - Set to true to hide from production
---- Always wrap string values in quotes
- Use ISO date format for dates:
YYYY-MM-DD - Tags must be an array:
["tag1", "tag2"] - The
orderfield is only used for docs, not blog posts
The following custom React components are available for use directly in MDX files without imports:
Displays a styled callout box for important information.
Syntax:
<Callout type="info">
This is helpful information with **markdown** support.
</Callout>Available Types:
| Type | Style | Use Case |
|---|---|---|
info |
Blue | General information, tips |
warning |
Amber/Yellow | Caution, important notices |
error |
Red | Critical warnings, breaking changes |
success |
Green | Completion confirmations, good practices |
Examples:
<Callout type="info">
Make sure you have Node.js 18+ installed.
</Callout>
<Callout type="warning">
This feature is experimental and may change.
</Callout>
<Callout type="error">
Never expose your API keys in client-side code.
</Callout>
<Callout type="success">
Your configuration is complete!
</Callout>Creates numbered step-by-step instructions with automatic numbering.
Syntax:
<Steps>
<Step>
### First Step Title
Content for the first step goes here.
</Step>
<Step>
### Second Step Title
Content for the second step.
```bash
npm installImportant Notes:
- Each
<Step>must be wrapped inside<Steps> - Leave empty lines before and after the
<Step>content - Steps are automatically numbered (1, 2, 3, etc.)
- You can include any markdown content inside steps including code blocks
Creates tabbed content sections for organizing related information.
Syntax:
<Tabs defaultValue="npm">
<TabsList>
<TabsTrigger value="npm">npm</TabsTrigger>
<TabsTrigger value="pnpm">pnpm</TabsTrigger>
<TabsTrigger value="yarn">yarn</TabsTrigger>
</TabsList>
<TabsContent value="npm">
```bash
npm install package-name
```
</TabsContent>
<TabsContent value="pnpm">
```bash
pnpm add package-name
```
</TabsContent>
<TabsContent value="yarn">
```bash
yarn add package-name
```
</TabsContent>
</Tabs>Important Notes:
- The
defaultValuemust match one of theTabsTriggervalues - Each
TabsContentvalue must match its correspondingTabsTriggervalue - Content inside tabs supports full markdown/MDX
All standard markdown is supported with enhanced styling.
# H1 - Page title (use sparingly, typically only once per page)
## H2 - Major sections (includes border-bottom styling)
### H3 - Subsections
#### H4 - Minor subsectionsNotes:
- H2 and H3 headings automatically generate anchor links for navigation
- Heading IDs are auto-generated from the heading text
**Bold text** for emphasis
*Italic text* for definitions or terms
`inline code` for code references, file names, commands
~~Strikethrough~~ for deprecated content[Internal link](/docs/installation)
[External link](https://example.com)- Internal links should use root-relative paths:
/docs/...,/blog/... - External links automatically open in new tabs with
noopener noreferrer
Unordered:
- First item
- Second item
- Nested item
Ordered:
1. First step
2. Second step
3. Third step> This is a blockquote for emphasis or quotations.
> It can span multiple lines.---Use standard GFM (GitHub Flavored Markdown) table syntax:
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |Alignment:
| Left | Center | Right |
|:-----|:------:|------:|
| L | C | R |
- Images are automatically styled with rounded corners and captions
- The alt text becomes the image caption if provided
- Supports both external URLs and local paths
Enhanced syntax highlighting powered by rehype-pretty-code.
```javascript
const greeting = "Hello, World!";
console.log(greeting);
``````tsx title="components/button.tsx"
export function Button({ children }) {
return <button className="btn">{children}</button>;
}
```Common languages with full syntax highlighting:
javascript/jstypescript/tstsx/jsxbash/shelljsonyamlmarkdown/mdxcsshtmlpythonenv(for environment variables)
Use single backticks for inline code:
Run `npm install` to install dependencies.
The `Button` component accepts a `variant` prop.- Start with context - Begin pages with a brief introduction
- Use progressive disclosure - Start simple, add complexity gradually
- Include practical examples - Show code that users can copy
- Link to related content - Connect to relevant docs
- Callouts - Use sparingly for truly important information
- Steps - Use for sequential instructions (installation, setup)
- Tabs - Use when showing equivalent alternatives (npm/pnpm/yarn)
- Code blocks - Always specify the language for proper highlighting
- Use second person ("you") to address the reader
- Use imperative mood for instructions ("Run the command")
- Keep paragraphs short and scannable
- Use code formatting for file names, commands, and technical terms
- Title - Should be descriptive and unique (50-60 characters ideal)
- Description - Summarize the page content (150-160 characters ideal)
- Headings - Use logical hierarchy (don't skip levels)
- Links - Use descriptive link text (not "click here")
---
title: "Installation"
description: "Learn how to install and configure the project."
order: 2
---
## Prerequisites
- Node.js 18 or later
- npm, yarn, or pnpm
## Installation
<Tabs defaultValue="npm">
<TabsList>
<TabsTrigger value="npm">npm</TabsTrigger>
<TabsTrigger value="pnpm">pnpm</TabsTrigger>
</TabsList>
<TabsContent value="npm">
```bash
npm install package-name
```
</TabsContent>
<TabsContent value="pnpm">
```bash
pnpm add package-name
```
</TabsContent>
</Tabs>
<Callout type="info">
Verify installation by running `package-name --version`.
</Callout>---
title: "Quick Start"
description: "Get started in 5 minutes."
---
## Quick Start
<Steps>
<Step>
### Initialize Your Project
Create a new directory and initialize the project:
```bash
mkdir my-project
cd my-project
npm init -ynpm install required-packagenpm start---
title: "API Reference"
description: "Complete API documentation."
---
## Endpoints
### GET /api/items
Fetches a list of items.
**Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | number | No | Max items to return |
| `offset` | number | No | Pagination offset |
**Response:**
```json
{
"items": [],
"total": 100
}| Element | Syntax | Notes |
|---|---|---|
| Callout | <Callout type="info">...</Callout> |
Types: info, warning, error, success |
| Steps | <Steps><Step>...</Step></Steps> |
Auto-numbered |
| Tabs | <Tabs defaultValue="x">...</Tabs> |
Match values carefully |
| Code block | ```lang title="file.ts" |
Language + optional title |
| Inline code | `code` |
For commands, names |
| Internal link | [Text](/docs/page) |
Root-relative paths |
| Image |  |
Alt text becomes caption |
- Always validate frontmatter - Missing required fields will cause build errors
- Test component syntax - Invalid JSX will break the page
- Preserve empty lines - Required around Steps/Step components
- Use consistent casing - kebab-case for files, proper casing in titles
- Avoid hardcoded namespaces - Use root-relative paths like
/docs/... - Include practical examples - Users benefit from copy-paste code
- Match tab values exactly - Mismatched values cause silent failures
Last updated: 2025-01-03