Skip to content

Configuration

The Starlight custom navigation plugin accepts an object with the following options. You can customize these options to fit your needs. The default values are provided for each option.

  • Type: boolean
  • Default: true
  • Description: Whether to show the custom tooltip (page title and keyboard shortcut) when hovering or focusing a navigation strip. When disabled, the browser’s native title tooltip shows the page name instead.
  • Type: object
  • Default: { previous: { key: 'ArrowLeft', modifier: 'ctrl' }, next: { key: 'ArrowRight', modifier: 'ctrl' } }
  • Description: Configure keyboard shortcuts for page navigation.
  • Type: object
  • Default: { key: 'ArrowLeft', modifier: 'ctrl' }
  • Description: Configuration for the “previous page” shortcut.
  • Type: string
  • Default: 'ArrowLeft'
  • Description: The key to use for the “previous page” shortcut.
  • Type: 'ctrl' | 'alt' | 'shift' | 'meta'
  • Default: 'ctrl'
  • Description: The modifier key to use with the shortcut.
  • Type: object
  • Default: { key: 'ArrowRight', modifier: 'ctrl' }
  • Description: Configuration for the “next page” shortcut.
  • Type: string
  • Default: 'ArrowRight'
  • Description: The key to use for the “next page” shortcut.
  • Type: 'ctrl' | 'alt' | 'shift' | 'meta'
  • Default: 'ctrl'
  • Description: The modifier key to use with the shortcut.
  • Type: object
  • Default: { hideDelay: 3000, hideThreshold: 100 }
  • Description: Auto-hide behavior of the compact floating buttons shown below 1280px.
  • Type: number
  • Default: 3000
  • Description: Time in milliseconds of inactivity before the floating buttons fade out.
  • Type: number
  • Default: 100
  • Description: Scroll distance in pixels required to bring hidden buttons back.

Here’s a complete example showing all available options:

astro.config.mjs
import { starlight } from '@astrojs/starlight'
import { defineConfig } from 'astro/config'
import starlightCustomNavigation from 'starlight-custom-navigation'
export default defineConfig({
integrations: [
starlight({
plugins: [
starlightCustomNavigation({
// Show tooltip on hover/focus (default: true)
showTooltip: true,
// Keyboard shortcuts
navShortcuts: {
previous: { key: 'ArrowLeft', modifier: 'ctrl' },
next: { key: 'ArrowRight', modifier: 'ctrl' }
},
// Auto-hide of the compact floating buttons (below 1280px)
scrollBehavior: {
hideDelay: 3000,
hideThreshold: 100
}
}),
],
title: 'My Docs',
}),
],
})