@kdupress/plugin-active-header-links (opens new window)
A plugin of automatically activating sidebar links when page scrolls
Install
yarn add -D @kdupress/plugin-active-header-links
# OR npm install -D @kdupress/plugin-active-header-links
Usage
module.exports = {
plugins: ['@kdupress/active-header-links']
}
Passing Options
module.exports = {
plugins: ['@kdupress/active-header-links', {
sidebarLinkSelector: '.sidebar-link',
headerAnchorSelector: '.header-anchor'
}]
}
Options
sidebarLinkSelector
- Type:
string
- Default:
.sidebar-link
headerAnchorSelector
- Type:
string
- Default:
.header-anchor