Skip to content

Getting Started

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.

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

    Terminal window
    npm install starlight-telescope
  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 starlightTelescope from 'starlight-telescope'
    export default defineConfig({
    integrations: [
    starlight({
    plugins: [starlightTelescope()],
    title: 'My Docs',
    }),
    ],
    })
  3. Start the development server to preview the plugin in action.

Once installed, press Ctrl+/ (or Cmd+/ on Mac) to open the search modal.

KeyAction
Arrow DownMove to next result
Arrow UpMove to previous result
EnterNavigate to selected page
SpacePin/unpin selected page
EscapeClose the modal

Customize the plugin by passing options:

starlightTelescope({
// Use Ctrl+K / Cmd+K instead
shortcut: { key: 'k', ctrl: true, meta: true },
// Show more recent pages
recentPagesCount: 10,
// Adjust search sensitivity
fuseOptions: { threshold: 0.4 },
})