Theme Configuration

Default theme configuration for navigation, sidebar, search, social links, and footer

Configure the default theme via themeConfig in your VitePress config.

export default {
  themeConfig: {
    // Site title in nav (overrides config.title)
    siteTitle: 'My Docs',
    siteTitle: false,  // Hide title
    
    // Logo
    logo: '/logo.svg',
    logo: { light: '/light-logo.svg', dark: '/dark-logo.svg', alt: 'Logo' },
    
    // Nav links
    nav: [
      { text: 'Guide', link: '/guide/' },
      { text: 'API', link: '/api/' },
      { text: 'GitHub', link: 'https://github.com/...' }
    ]
  }
}

Active Match

Control when nav item shows as active:

Simple Sidebar

Multiple Sidebars

Different sidebar per section:

Collapsible Groups

Base Path

Simplify links with common base:

With options:

Algolia DocSearch

Footer only displays on pages without sidebar.

:path is replaced with the page's source file path.

Last Updated

Enable in site config:

Customize display:

Outline (Table of Contents)

Or just the level:

Appearance Toggle Labels

Key Points

  • nav defines top navigation links

  • sidebar can be array (single) or object (multiple sidebars)

  • Use collapsed for collapsible sidebar sections

  • Local search works out of the box

  • editLink.pattern uses :path placeholder

  • Enable lastUpdated in site config, customize in themeConfig

Last updated

Was this helpful?