Getting Started
Add a scroll to top button to your documentation website.
Prerequisites
Section titled “Prerequisites”You will need to have a Starlight website set up. If you don’t have one yet, you can follow the “Getting Started” guide in the Starlight docs to create one.
Installation
Section titled “Installation”-
starlight-scroll-to-top
is a Starlight plugin. Install it by running the following command in your terminal:Terminal window npm install starlight-scroll-to-topTerminal window pnpm add starlight-scroll-to-topTerminal window yarn add starlight-scroll-to-top -
Configure the plugin in your Starlight configuration in the
astro.config.mjs
file.astro.config.mjs import starlight from '@astrojs/starlight'import { defineConfig } from 'astro/config'import starlightScrollToTop from 'starlight-scroll-to-top'export default defineConfig({integrations: [starlight({plugins: [starlightScrollToTop()],title: 'My Docs',}),],}) -
Start the development server to preview the plugin in action.