Skip to content

Getting Started

Enhance Starlight’s table of contents with customizable overview title

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

  1. starlight-toc-overview-customizer is a Starlight plugin. Install it by running the following command in your terminal:

    Terminal window
    npm install starlight-toc-overview-customizer
  2. 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 starlightTocOverviewCustomizer from 'starlight-toc-overview-customizer'
    export default defineConfig({
    integrations: [
    starlight({
    plugins: [starlightTocOverviewCustomizer({
    overviewTitle: "Back to top",
    })],
    title: 'My Docs',
    }),
    ],
    })

    You can view this example configuration on this site.

  3. Start the development server to preview the plugin in action.

Check out the configuration options or frontmatter guide for more information on how to customize the plugin.