Back-to-top plugin for VitePress
Available as an npm package
// with npm
npm i vitepress-plugin-back-to-top
// with yarn
yarn add vitepress-plugin-back-to-top
// .vitepress/theme/index.js
import DefaultTheme from 'vitepress/theme'
import vitepressBackToTop from 'vitepress-plugin-back-to-top'
import 'vitepress-plugin-back-to-top/dist/style.css'
export default {
...DefaultTheme,
enhanceApp({ app }) {
vitepressBackToTop({
// default
threshold:300
})
},
}