@vuepress/plugin-active-header-links

A plugin of automatically activating sidebar links when page scrolls

Install

yarn add -D @vuepress/plugin-active-header-links@next
# OR npm install -D @vuepress/plugin-active-header-links@next

Usage

module.exports = {
  plugins: ['@vuepress/active-header-links']
}

Passing Options

module.exports = {
  plugins: ['@vuepress/active-header-links', {
    sidebarLinkSelector: '.sidebar-link',
    headerAnchorSelector: '.header-anchor',
    headerTopOffset: 120
  }]
}

Options

sidebarLinkSelector

  • Type: string
  • Default: .sidebar-link

headerAnchorSelector

  • Type: string
  • Default: .header-anchor