@miletorix/vitepress-back-to-top-button
A lightweight Back-to-Top button Vue 3 component for VitePress. Features smooth scroll, progress ring indicating scroll percentage, dark/light theme support.
2,579
7
| Install | |
|---|---|
npm install @miletorix/vitepress-back-to-top-button |
|
| Latest Version: | 1.0.3 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Dec 30, 2025 |
| Links: | GitHub · npm |
Maintainer: miletorix
vitepress-back-to-top-button
A lightweight Back-to-Top button Vue 3 component for VitePress. Features smooth scroll, progress ring indicating scroll percentage, dark/light theme support.
Live Demo and more information
✨ See it in action:
👉 https://miletorix.github.io/vitepress-back-to-top-button/
Installation
npm i @miletorix/vitepress-back-to-top-button
Usage
Configuration
// docs/.vitepress/theme/index.ts
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import BackToTopButton from '@miletorix/vitepress-back-to-top-button' //[!code ++]
import '@miletorix/vitepress-back-to-top-button/style.css' //[!code ++]
export default {
extends: DefaultTheme,
enhanceApp(ctx) {
BackToTopButton(ctx.app) //[!code ++]
}
}
Advanced configuration
// docs/.vitepress/theme/index.ts
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import BackToTopButton from '@miletorix/vitepress-back-to-top-button' //[!code ++]
import '@miletorix/vitepress-back-to-top-button/style.css' //[!code ++]
export default {
extends: DefaultTheme,
enhanceApp(ctx) {
BackToTopButton(ctx.app, { // [!code ++]
progressColor: 'string', // default is #42b983 [!code ++]
arrowSvg: `string` // only svg code [!code ++]
})
}
}
Preview
Preview - Desktop

Related Packages
yn-components
Advanced and highly reusable Mobile UI Components built on Vue2 & You can define...
3,128
6
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.0.3 | ^3.0.0 | MIT | |
| 1.0.2 | ^3.0.0 | MIT | |
| 1.0.1 | ^3.0.0 | MIT | |
| 1.0.0 | ^3.0.0 | MIT | |
| 0.2.3 | ^3.0.0 | MIT | |
| 0.2.2 | ^3.0.0 | MIT | |
| 0.2.1 | ^3.0.0 | MIT | |
| 0.2.0 | ^3.0.0 | MIT | |
| 0.1.2 | ^3.0.0 | MIT | |
| 0.1.1 | ^3.0.0 | MIT | |
| 0.1.0 | ^3.0.0 | MIT |