Skip to content

Component Showcase

This page showcases all the components and plugins available in this documentation template. Use them to create rich, interactive documentation pages.

Use tabs to organize content by context, such as different package managers or languages.

Terminal window
npm install astro-starlight-docs-template

Analytics

Google Analytics 4 with Consent Mode v2 and IP anonymization.

GDPR

Automatic GDPR compliance with regional cookie consent.

SEO

Open Graph, Twitter Cards, and Schema.org structured data.

LLM Support

AI-friendly metadata and llms.txt generation.

One Command

Run npx astro-starlight-docs-template init and you’re done.

Zero Config

Sensible defaults for everything. Customize only what you need.

Use the Steps component for sequential instructions.

  1. Install the package

    Terminal window
    npx astro-starlight-docs-template init
  2. Answer the prompts

    Provide your Google Analytics ID, site URL, and preferences.

  3. Build your site

    Terminal window
    npm run build
  4. Deploy

    Push to GitHub Pages, Vercel, Netlify, or any static host.

Visualize your project structure.

  • Directorysrc/
    • Directorycomponents/
      • Footer.astro (custom footer)
    • Directorycontent/
      • Directoryblog/
        • welcome.md
        • openapi-support.md
      • Directorydocs/
        • index.mdx
        • Directorygetting-started/
          • quick-start.md
          • installation.md
        • Directoryfeatures/
          • overview.md
          • analytics.md
        • Directoryguides/
          • component-showcase.mdx (this file)
    • Directorystyles/
      • custom.css
  • Directoryschemas/
    • openapi.yaml
  • Directorypublic/
    • cookie-consent.js
    • favicon.svg
  • astro.config.mjs
  • package.json

Inline badges for status indicators:

  • Stable Production-ready features
  • Beta Features in testing
  • Deprecated Features being removed
  • New Recently added features

This template includes Mermaid diagram support. Use fenced code blocks with the mermaid language.

astro.config.mjs
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import starlightOpenAPI from 'starlight-openapi';
export default defineConfig({
integrations: [
starlight({
plugins: [
starlightOpenAPI([{
base: 'api',
schema: './schemas/openapi.yaml',
}]),
],
}),
],
});
// Before
const config = {
- analytics: false,
- gdpr: false,
+ analytics: true,
+ gdpr: true,
+ seo: {
+ ogImage: '/og-image.svg',
+ twitterCard: 'summary_large_image',
+ },
};
Terminal window
$ npx astro-starlight-docs-template init
🚀 Astro Starlight Docs Template v1.0.1
🔍 Checking if this is an Astro Starlight project...
Astro project detected
Starlight integration found
? Google Analytics Measurement ID: G-XXXXXXXXXX
? Site URL: https://example.com
? Create custom footer? Yes
All done! Run `npm run build` to see your changes.

This template includes the starlight-openapi plugin which auto-generates API documentation from OpenAPI/Swagger specifications. Check the API Reference section in the sidebar to see it in action.

The API docs are generated from schemas/openapi.yaml and include:

  • Individual pages for each endpoint
  • Request/response schemas
  • Parameter documentation
  • Example values

Images in this documentation support click-to-zoom for better readability. Try clicking on the hero image on the home page.

This template includes a blog section powered by starlight-blog. The blog lives alongside your documentation and supports posts, tags, authors, and RSS feeds.

All these components are available out of the box in this template:

ComponentSourceType
TabsBuilt-inInteractive
Cards / CardGridBuilt-inLayout
LinkCardBuilt-inNavigation
StepsBuilt-inSequential
FileTreeBuilt-inVisualization
BadgeBuilt-inInline
AsidesBuilt-inCallout
Mermaid DiagramsPluginVisualization
OpenAPI DocsPluginAPI Reference
Image ZoomPluginEnhancement
BlogPluginContent
Link ValidationPluginBuild-time check