Skip to content

Commit 513a810

Browse files
authored
[Starlight] Add scroll to top button (#25886)
1 parent 956cad6 commit 513a810

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

astro.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import starlightDocSearch from "@astrojs/starlight-docsearch";
44
import starlightImageZoom from "starlight-image-zoom";
55
import liveCode from "astro-live-code";
66
import starlightLinksValidator from "starlight-links-validator";
7+
import starlightScrollToTop from "starlight-scroll-to-top";
78
import icon from "astro-icon";
89
import sitemap from "@astrojs/sitemap";
910
import react from "@astrojs/react";
@@ -162,6 +163,14 @@ export default defineConfig({
162163
clientOptionsModule: "./src/plugins/docsearch/index.ts",
163164
}),
164165
starlightImageZoom(),
166+
starlightScrollToTop({
167+
tooltipText: "Back to top",
168+
showTooltip: true,
169+
svgPath: "M12 6L6 12M12 6L18 12M12 12L6 18M12 12L18 18",
170+
showProgressRing: true,
171+
progressRingColor: "white",
172+
showOnHomepage: false, // Hide on homepage (default)
173+
}),
165174
],
166175
lastUpdated: true,
167176
markdown: {

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
"starlight-image-zoom": "0.13.0",
122122
"starlight-links-validator": "0.17.2",
123123
"starlight-package-managers": "0.11.0",
124+
"starlight-scroll-to-top": "0.4.0",
124125
"starlight-showcases": "0.3.0",
125126
"strip-markdown": "6.0.0",
126127
"suf-log": "2.5.3",

0 commit comments

Comments
 (0)