<!--
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
-->

# Slots \[Inject custom components into the docs shell]

Slots let you replace specific regions of the Vocs layout — the footer, the outline footer, and the sidebar header — without writing a custom layout.

## File Convention

Create `src/pages/_slots.tsx` and export any of the supported slot components. Vocs picks them up at build time and renders them in place.

```tsx [src/pages/_slots.tsx]
export function Footer() {
  return (
    <div className="vocs:text-center vocs:text-secondary vocs:text-sm vocs:pt-6">
      © 2025 My Project. All rights reserved.
    </div>
  )
}

export function OutlineFooter() {
  return (
    <div className="vocs:text-xs vocs:text-secondary">
      Need help?{' '}
      <a className="vocs:text-accent vocs:hover:underline" href="https://discord.gg/example">
        Join our Discord
      </a>
    </div>
  )
}

export function SidebarHeader() {
  return <div className="vocs:px-4 vocs:py-2 vocs:text-sm">Custom Sidebar Header</div>
}
```

You can export any subset of these — exports you omit fall back to the default Vocs UI.

## Supported Slots

### `Footer`

Rendered at the bottom of every page, below the page content and pagination.

Use this for site-wide attribution, copyright, or extra links.

### `OutlineFooter`

Rendered at the bottom of the right-hand outline (table of contents), beneath the page outline and feedback widget.

Use this for short helpful pointers like a community link or contributor note.

### `SidebarHeader`

Rendered at the top of the left sidebar, above the navigation tree.

Use this for a version switcher, environment badge, or product picker.

## Tips

* Slot components run in React Server Components by default. Add `'use client'` if you need browser APIs.
* Style with the `vocs:` Tailwind prefix to stay consistent with the rest of the theme.
* Slots are reactive to HMR — saving `_slots.tsx` updates the page immediately in dev.

## See Also

* [Layouts](/features/layouts)
* [MDX Wrapper](/features/layouts#mdx-wrapper)
* [Theming](/features/theming)
