Skip to content

Theme Configuration Reference

Complete reference for VitePress theme configuration options.

js
nav: [
  { text: 'Guide', link: '/guide/' },
  { text: 'External', link: 'https://example.com' },
  {
    text: 'Dropdown',
    items: [
      { text: 'Item 1', link: '/item-1' },
      { text: 'Item 2', link: '/item-2' },
    ],
  },
]
PropertyTypeDescription
textstringDisplay text
linkstringPage link or external URL
activeMatchstringRegex for active state
itemsarrayDropdown items
attrsobjectCustom HTML attributes
js
sidebar: [
  {
    text: 'Section',
    collapsed: false,
    items: [
      { text: 'Page', link: '/page' },
    ],
  },
]
PropertyTypeDescription
textstringSection title
itemsarrayPage links
collapsedbooleanCollapsible section
js
socialLinks: [
  { icon: 'github', link: 'https://github.com' },
  { icon: 'twitter', link: 'https://twitter.com' },
  { icon: 'discord', link: 'https://discord.gg/invite' },
]
js
footer: {
  message: 'Licensed under MIT',
  copyright: '© 2025 Author Name',
}
js
editLink: {
  pattern: 'https://github.com/user/repo/edit/main/docs/:path',
  text: 'Edit this page',
}
js
search: {
  provider: 'local',  // or 'algolia'
}

Local Search Options

js
search: {
  provider: 'local',
  options: {
    miniSearch: {
      options: {
        fuzzy: 0.2,
        prefix: true,
      },
    },
  },
}

Outline

js
outline: {
  level: [2, 3],
  label: 'On This Page',
}
js
docFooter: {
  prev: 'Previous',
  next: 'Next',
}

Dark Mode

js
darkModeSwitchLabel: 'Appearance',
lightModeSwitchTitle: 'Switch to light theme',
darkModeSwitchTitle: 'Switch to dark theme',

Carbon Ads

js
carbonAds: {
  code: 'your-carbon-code',
  placement: 'your-placement',
}

VitePress Course — Complete Tutorial