Skip to main content

Theme Config Reference

Theme config allows you to customize the default theme. Define theme config via the themeConfig option in your config file.
export default {
  themeConfig: {
    logo: '/logo.svg',
    nav: [...],
    sidebar: {...}
  }
}
These options only apply to the default theme. Custom themes may have different configurations.

Branding

Logo file to display in the navbar, right before the site title. Accepts a path string or an object to set different logos for light/dark mode.
export default {
  themeConfig: {
    logo: '/logo.svg'
  }
}
Overrides the link of the site logo. Useful if you want the logo to link to an external site.
export default {
  themeConfig: {
    logoLink: 'https://example.com'
  }
}

siteTitle

siteTitle
string | false
Customizes the site title in navbar. If undefined, config.title will be used. Set to false to disable the title.Useful when your logo already contains the site title text.
export default {
  themeConfig: {
    siteTitle: 'My Custom Title'
  }
}
nav
NavItem[]
Configuration for the navigation menu in the navbar.
export default {
  themeConfig: {
    nav: [
      { text: 'Guide', link: '/guide' },
      { text: 'API', link: '/api' },
      { text: 'Blog', link: '/blog' }
    ]
  }
}
sidebar
Sidebar
Configuration for the sidebar menu. Can be a simple array or an object with multiple sidebars for different sections.
export default {
  themeConfig: {
    sidebar: [
      {
        text: 'Guide',
        items: [
          { text: 'Introduction', link: '/introduction' },
          { text: 'Getting Started', link: '/getting-started' }
        ]
      },
      {
        text: 'API',
        items: [
          { text: 'Site Config', link: '/api/site-config' },
          { text: 'Theme Config', link: '/api/theme-config' }
        ]
      }
    ]
  }
}

Content Layout

aside

aside
boolean | 'left'
default:"true"
Controls the rendering of the aside (table of contents) container.
  • false: No aside
  • true: Aside to the right
  • 'left': Aside to the left
Can be overridden per page via frontmatter.
export default {
  themeConfig: {
    aside: 'left'
  }
}

outline

outline
Outline | Outline['level'] | false
default:"2"
Configure the outline (table of contents) displayed in the aside.Can be overridden per page via frontmatter (level only).
export default {
  themeConfig: {
    outline: 2  // Only <h2> headings
  }
}

outlineTitle

outlineTitle
string
default:"On this page"
Deprecated: Use outline.label instead.Custom title for the outline in the aside component.
Social account links with icons displayed at the end of the nav bar. Supports any icon from simple-icons or custom SVG.
export default {
  themeConfig: {
    socialLinks: [
      { icon: 'github', link: 'https://github.com/vuejs/vitepress' },
      { icon: 'twitter', link: 'https://twitter.com/yourusername' },
      { icon: 'discord', link: 'https://discord.gg/yourserver' }
    ]
  }
}

externalLinkIcon

Show an external link icon next to external links in markdown content.
export default {
  themeConfig: {
    externalLinkIcon: true
  }
}
Footer configuration. Only displayed when the page doesn’t contain a sidebar.Can be overridden per page via frontmatter.
export default {
  themeConfig: {
    footer: {
      message: 'Released under the MIT License.',
      copyright: 'Copyright © 2019-present Evan You'
    }
  }
}

docFooter

Customize the text appearing in the previous/next page navigation. Can disable prev/next links by setting to false.
export default {
  themeConfig: {
    docFooter: {
      prev: 'Previous',
      next: 'Next'
    }
  }
}
Display a link to edit the page on Git management services (GitHub, GitLab, etc.).Can be overridden per page via frontmatter.
export default {
  themeConfig: {
    editLink: {
      pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path',
      text: 'Edit this page on GitHub'
    }
  }
}

Last Updated

lastUpdated

lastUpdated
LastUpdatedOptions
Customize the last updated text and date format.
export default {
  themeConfig: {
    lastUpdated: {
      text: 'Updated at',
      formatOptions: {
        dateStyle: 'full',
        timeStyle: 'medium'
      }
    }
  }
}

lastUpdatedText

lastUpdatedText
string
default:"Last updated"
Deprecated: Use lastUpdated.text instead.Custom text for the last updated label.

search

Search configuration. Supports local search or Algolia DocSearch.

Advertising

carbonAds

carbonAds
CarbonAdsOptions
Display Carbon Ads on your site.
export default {
  themeConfig: {
    carbonAds: {
      code: 'your-carbon-code',
      placement: 'your-carbon-placement'
    }
  }
}

Internationalization

i18nRouting

i18nRouting
boolean
default:"true"
Changing locale to say zh will change the URL from /foo (or /en/foo/) to /zh/foo. Set to false to disable this behavior.
export default {
  themeConfig: {
    i18nRouting: false
  }
}

langMenuLabel

langMenuLabel
string
default:"Change language"
Custom aria-label for the language menu button.
export default {
  themeConfig: {
    langMenuLabel: 'Select language'
  }
}

Accessibility Labels

These options are only displayed in mobile view or for screen readers.

darkModeSwitchLabel

darkModeSwitchLabel
string
default:"Appearance"
Label for the dark mode switch (mobile view only).

lightModeSwitchTitle

lightModeSwitchTitle
string
default:"Switch to light theme"
Hover title for the light mode switch.

darkModeSwitchTitle

darkModeSwitchTitle
string
default:"Switch to dark theme"
Hover title for the dark mode switch.

sidebarMenuLabel

sidebarMenuLabel
string
default:"Menu"
Label for the sidebar menu (mobile view only).

returnToTopLabel

returnToTopLabel
string
default:"Return to top"
Label for the return to top button (mobile view only).

skipToContentLabel

skipToContentLabel
string
default:"Skip to content"
Label for the skip to content link (keyboard navigation).

404 Page

notFound

notFound
NotFoundOptions
Customize the 404 page text and behavior.
export default {
  themeConfig: {
    notFound: {
      title: 'Oops! Page Not Found',
      quote: 'The page you are looking for does not exist.',
      linkText: 'Go back home',
      code: '404'
    }
  }
}

Build docs developers (and LLMs) love