Skip to content

Using Starlight Plugins

Starlight has a rich ecosystem of plugins that can be used to extend the functionality of your documentation site. In this project, we have implemented starlight-image-zoom as an example.

This library adds zoom capabilities to images in your documentation. Images on the page can be clicked to enlarge them.

  1. Install the package:

    Terminal window
    npm install starlight-image-zoom
  2. Configure astro.config.mjs:

    Import the plugin and add it to the plugins array in the Starlight configuration.

    astro.config.mjs
    import starlight from '@astrojs/starlight';
    import starlightImageZoom from 'starlight-image-zoom';
    export default defineConfig({
    integrations: [
    starlight({
    // ...
    plugins: [
    starlightImageZoom(),
    ],
    }),
    ],
    });
  3. Usage:

    No special markup is required. All images in Markdown/MDX files will automatically support zooming functionality.

    Example Image

Here are some other useful plugins for Starlight:

  • starlight-links-validator: Automatically checks for broken links in your documentation.
  • starlight-typedoc: Generates documentation from TypeScript code managed with TypeDoc.
  • starlight-openapi: Generates documentation from OpenAPI specifications.

For more information, visit the Starlight Plugins Directory.