Overview

Every MDX content page starts with a YAML frontmatter block. This page documents every supported field and which components they control.

Complete Schema

interface DocsFrontmatter {
  title: string;
  description?: string;
  sidebar?: {
    label?: string;
    order?: number;
    hidden?: boolean;
  };
  tableOfContents?: {
    minHeadingLevel?: number;
    maxHeadingLevel?: number;
  };
  banner?: {
    content: string;
  };
  hero?: {
    title?: string;
    tagline?: string;
    image?: { src: string; alt: string };
    actions?: Array<{
      text: string;
      link: string;
      variant?: 'primary' | 'secondary' | 'minimal';
      icon?: string;
    }>;
  };
  editUrl?: string | false;
  lastUpdated?: Date | boolean;
  draft?: boolean;
}

Field Reference

title (required)

title: My Page Title

Rendered by PageTitle component as an <h1>. Also used in the <head> document title.

description

description: A brief description of this page.

Used in <meta name="description"> for SEO.

sidebar:
  label: Custom Label    # Override the title in the sidebar
  order: 1               # Sort order (lower = higher)
  hidden: true           # Hide from sidebar navigation

tableOfContents

tableOfContents:
  minHeadingLevel: 2
  maxHeadingLevel: 4

Controls which headings appear in the table of contents.

banner:
  content: "Important announcement! <a href='/news'>Read more</a>."

Renders a Banner component at the top of the page. Supports HTML.

hero

hero:
  title: Welcome
  tagline: Build amazing docs
  image:
    src: /hero.png
    alt: Hero image
  actions:
    - text: Get Started
      link: /docs/intro/
      variant: primary
    - text: GitHub
      link: https://github.com/example
      variant: secondary

Renders a Hero component that replaces the normal page title.

editUrl

editUrl: https://github.com/example/repo/edit/main/docs/page.mdx

Or disable it:

editUrl: false

lastUpdated

lastUpdated: 2024-06-15

Renders a LastUpdated component in the footer.

draft

draft: true

Renders a DraftContentNotice at the top of the page. See the Content Notice page for a live example.

Components Controlled by Frontmatter

FieldComponentLocation
titlePageTitleMain content area
heroHeroAbove content (replaces title)
bannerBannerTop of page
draftDraftContentNoticeAbove content
lastUpdatedLastUpdatedFooter
editUrlEditLinkFooter
tableOfContentsTableOfContentsRight sidebar
sidebarSidebarLeft sidebar