Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsMay 3, 2026·3 min de lectura

Starlight — Documentation Framework for Astro

Starlight is a full-featured documentation framework built on Astro that generates fast, accessible, and SEO-friendly docs sites from Markdown and MDX with built-in navigation, search, and internationalization.

Introduction

Documentation sites share a common set of requirements: sidebar navigation, search, multi-language support, and fast page loads. Starlight provides all of these out of the box as an Astro integration, letting you focus on writing content in Markdown or MDX while it handles the site infrastructure, design, and performance optimization.

What Starlight Does

  • Generates a complete documentation site from Markdown and MDX files with zero configuration
  • Provides automatic sidebar navigation derived from the file structure and frontmatter
  • Includes built-in full-text search powered by Pagefind with no external dependencies
  • Supports internationalization with per-locale content directories and language switching
  • Ships minimal JavaScript by default, producing fast static pages through Astro's island architecture

Architecture Overview

Starlight is an Astro integration that adds a content collection schema, page layouts, and UI components optimized for documentation. Content is authored as Markdown or MDX files in a src/content/docs directory. Astro processes each file at build time, rendering pages to static HTML with optional interactive islands for search and navigation. Pagefind indexes the built output to provide client-side search without a server. The sidebar is generated from the directory structure and can be customized through astro.config.mjs or per-page frontmatter. Because Starlight builds on Astro, you can use components from React, Vue, Svelte, or any other framework alongside your documentation.

Self-Hosting & Configuration

  • Create a new project with npm create astro -- --template starlight
  • Add documentation pages as .md or .mdx files in src/content/docs/
  • Configure sidebar groups, ordering, and labels in astro.config.mjs
  • Customize the theme with CSS custom properties for colors, fonts, and layout
  • Deploy as a static site to any CDN (Netlify, Vercel, Cloudflare Pages, GitHub Pages)

Key Features

  • Near-zero JavaScript output produces documentation pages that load in milliseconds
  • Pagefind search runs entirely client-side and indexes content automatically at build time
  • Built-in i18n supports multiple languages with locale-aware navigation and content fallbacks
  • Accessible by default with semantic HTML, ARIA attributes, keyboard navigation, and color contrast
  • Plugin API and component overrides allow deep customization without forking the framework

Comparison with Similar Tools

  • Docusaurus — React-based with heavier client-side JavaScript; Starlight ships minimal JS for faster loads
  • Nextra — Next.js-based docs framework; Starlight uses Astro for better static performance and framework flexibility
  • VitePress — Vue-centric and fast; Starlight is framework-agnostic and uses Pagefind for search instead of MiniSearch
  • MkDocs — Python and Jinja templates; Starlight supports MDX with interactive components from any JS framework
  • GitBook — Hosted platform with vendor lock-in; Starlight is self-hosted and fully open source

FAQ

Q: Can I use React or Vue components in my Starlight docs? A: Yes. Astro's island architecture lets you import and render components from React, Vue, Svelte, and other frameworks in your MDX files.

Q: Does Starlight require a server or can it be fully static? A: Starlight generates a fully static site by default. No server is needed — deploy the output to any CDN or static hosting service.

Q: How do I add search to my Starlight site? A: Search is built in and enabled by default. Pagefind indexes your content at build time and provides client-side search with no configuration needed.

Q: Can I customize the look and feel of my Starlight site? A: Yes. Starlight supports CSS custom properties for theming, component overrides for structural changes, and custom pages for fully custom layouts.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados