<!--
Sitemap:
- [What is Vocs](/introduction/what-is-vocs): Learn why Vocs exists and when to use it
- [Getting Started](/introduction/getting-started): Install Vocs and create your first documentation site
- [Project Structure](/introduction/project-structure): Overview of the structure of a Vocs project
- [Writing Docs with AI](/introduction/writing-docs-with-ai): Use an AI agent to create and maintain Vocs documentation
- [Markdown Extensions](/writing/markdown-extensions): Features and syntax of Markdown in Vocs
- [Code & Syntax Highlighting](/writing/syntax-highlighting): Rich markup and annotations for code
- [Twoslash](/writing/twoslash): Add type-aware annotations to code examples
- [Code Snippets](/writing/code-snippets): Include and reuse code in Markdown
- [Markdown Snippets](/writing/markdown-snippets): Include other Markdown files in MDX
- [React in Markdown](/writing/react): Compose MDX pages with React components
- [Mermaid Diagrams](/writing/mermaid): Render diagrams from text using Mermaid
- [Assets](/writing/assets): Manage images, fonts, icons, and other docs assets
- [Frontmatter](/writing/frontmatter): Configure page metadata, layouts, search, and UI visibility
- [Navigation](/features/navigation): Keep docs navigation synced with routes
- [Search](/features/search): Built-in client-side search powered by MiniSearch
- [Layouts](/features/layouts): Choose and customize page shells for your docs
- [Slots](/features/slots): Inject custom components into the docs shell
- [Theming](/features/theming): Customize colors, typography, spacing, logos, and code themes
- [Tailwind CSS](/features/tailwind): Use Tailwind utilities in Vocs pages and components
- [Dynamic OG Images](/features/dynamic-og-images): Generate social preview images from page metadata
- [Page Feedback](/features/feedback): Collect page-level feedback from readers
- [Redirects](/features/redirects): Preserve old URLs and route legacy paths to new locations
- [API Routes](/features/api-routes): Add server-rendered endpoints to your docs site
- [Agent Support](/features/agent-support): Serve documentation in machine-readable form for AI agents
- [Ask AI](/features/ask-ai): Built-in AI assistant menu on every page
- [MCP Server](/features/mcp-server): Expose your docs and source code to AI assistants
- [Changelog Generation](/features/changelog-generation): Fetch release notes and render a changelog page
- [Site Configuration](/reference/site-config): Reference for options accepted by defineConfig
- [Frontmatter Reference](/reference/frontmatter): All frontmatter fields accepted by a Vocs MDX page
- [Components](/reference/components): Reference for the public React components exported from Vocs
- [Hooks](/reference/hooks): Reference for the React hooks exported from Vocs
- [Changelog](/changelog): Release history for Vocs
-->

# Layouts \[Choose and customize page shells for your docs]

Vocs ships with three built-in page layouts controlled by frontmatter:

* `full`
* `minimal`
* `blank`

Use these when you want to change the page chrome around your MDX content. For the full set of page-level options, see [Frontmatter](/writing/frontmatter).

## Default Layout

Pages use `layout: full` by default.

The full layout is the standard docs experience:

* sidebar navigation
* top navigation
* main content
* page outline
* pagination, edit link, and last updated footer under the page content

```mdx
---
layout: full
---
```

Use it for most documentation pages.

## Minimal Layout

The minimal layout removes the sidebar and keeps the page focused on the content.

```mdx
---
layout: minimal
---
```

Use it for pages like landing pages, guides with a custom hero, or standalone docs pages that should not inherit the full sidebar shell.

The homepage in this repo uses `minimal` plus a couple of visibility toggles:

```mdx
---
layout: minimal
showAskAi: false
showLogo: false
---
```

By default, `minimal` also hides the outline, but you can opt back into it:

```mdx
---
layout: minimal
outline: true
---
```

## Blank Layout

The blank layout strips the page shell down to the content area.

```mdx
---
layout: blank
---
```

Use it when you want to provide nearly all of the page structure yourself inside MDX.

By default, `blank` hides the top nav, sidebar, outline, search UI, and Ask AI button. You can enable specific pieces with frontmatter such as `showTopNav`, `showSearch`, or `showAskAi`.

## Layout Overrides

Layouts set defaults, but you can override individual parts of the shell per page with frontmatter:

* `showSidebar`
* `showTopNav`
* `showLogo`
* `showSearch`
* `showAskAi`
* `showFeedback`
* `outline`

```mdx
---
layout: blank
showTopNav: true
showSearch: true
outline: 2
---
```

This is often simpler than changing layouts entirely.

## MDX Wrapper

If you need more than the built-in shells, create an `_mdx-wrapper.tsx` file in a pages directory. The wrapper applies to every Markdown and MDX page in that directory and its subdirectories. It does not apply to `src/pages/_api/` routes.

The nearest wrapper wins — a deeper `_mdx-wrapper.tsx` takes precedence over a shallower one for that subtree.

:::file-tree

* +src
  * +pages
    * **\_mdx-wrapper.tsx** ← applies to all MDX pages
    * index.mdx
    * +guides
      * **\_mdx-wrapper.tsx** ← applies to pages in /guides/\*
      * intro.mdx
        :::

### Writing a Wrapper

The wrapper receives the MDX children plus the page's frontmatter and path.

```tsx [src/pages/guides/_mdx-wrapper.tsx]
import type { ReactNode } from 'react'

type Props = {
  children: ReactNode
  frontmatter: {
    title?: string
    description?: string
    [key: string]: unknown
  }
  path: string
}

export default function GuidesWrapper({ children, frontmatter, path }: Props) {
  return (
    <div>
      <header className="vocs:mb-6 vocs:border-b vocs:pb-4">
        <p className="vocs:text-xs vocs:text-secondary">Guides · {path}</p>
        {frontmatter.title && <h1>{frontmatter.title}</h1>}
        {frontmatter.description && (
          <p className="vocs:text-secondary">{frontmatter.description}</p>
        )}
      </header>
      {children}
    </div>
  )
}
```

### When to Use a Wrapper

* A **section banner** ("Beta", "Deprecated", "v2 docs") for everything inside a subtree.
* A **hero/header pattern** for landing pages like `/blog/*` or `/recipes/*`.
* **Section-scoped UI** — e.g. table of contents for a tutorial series, a stepper for an onboarding flow.
* Injecting **section-specific MDX components** by composing your own `MDXProvider`.

## Wrapper vs Layout vs Slots

Choose the smallest tool that solves the problem:

| Use a… | File | When you want to… |
|---|---|---|
| [Layout](#default-layout) | `frontmatter.layout` | Switch the entire page shell (`full` / `minimal` / `blank`). |
| [Wrapper](#mdx-wrapper) | `_mdx-wrapper.tsx` | Add chrome to MDX pages within a directory subtree. |
| [Slot](/features/slots) | `_slots.tsx` | Replace specific regions of the global shell (`Footer`, `OutlineFooter`, `SidebarHeader`). |

A page can use all three: layout sets the shell, the wrapper handles in-content chrome, and slots customize global regions.

## See Also

* [Frontmatter reference](/reference/frontmatter)
* [Slots](/features/slots)
