Docusaurus vs Starlight for Product Documentation
Product documentation has a specific shape: several hundred task and reference pages, a changelog, an API section, frequent small edits by writers and support staff, and readers who arrive from search on a phone with one question. Both Docusaurus and Starlight handle that shape; the question is which one handles it cheaply over years. This comparison ports one real site — 640 pages of SaaS product docs with 210 screenshots, 48 embedded code tabs and 3 interactive API playgrounds — to both, and measures what changes.
The wider three-way picture, including VitePress, is in Docs Frameworks: Docusaurus, Starlight and VitePress.
Prerequisites
- Node.js 20 or later and a content set in Markdown or MDX with front matter.
- A Lighthouse CI setup or equivalent to measure every build the same way — see Setting Up Lighthouse CI for a Static Site.
- Real-user monitoring for INP if you want field numbers rather than lab estimates.
- Roughly two engineer-days per framework for a port of this size, most of it spent on custom components.
The Port, Step by Step
The site started on Docusaurus 3.8 with the classic theme and six swizzled components. The Starlight port followed four steps.
1. Scaffold and move content. npm create astro@latest -- --template starlight produces src/content/docs/. The 640 files moved across unchanged except for front matter: Docusaurus's sidebar_position became Starlight's sidebar: { order: n }, done with a forty-line script of the kind described in Converting Front Matter at Scale During Migration.
2. Replace admonitions and tabs. Docusaurus :::note admonitions work unchanged in Starlight, which supports the same directive syntax as asides. The <Tabs>/<TabItem> imports needed rewriting to Starlight's <Tabs>/<TabItem> from @astrojs/starlight/components — same names, different import path, so a codemod handled all 48.
3. Rebuild the sidebar. Docusaurus's sidebars.js was translated into Starlight's sidebar config, using autogenerate: { directory: 'guides' } for four of the six sections so new pages appear without config edits.
4. Port the playgrounds. The three API playgrounds were React components. They kept working through @astrojs/react with client:visible, so their JavaScript loads only when scrolled into view — the pattern from Deferring Hydration with client:visible in Astro.
// astro.config.mjs
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import react from '@astrojs/react';
export default defineConfig({
site: 'https://docs.example.com',
trailingSlash: 'always',
integrations: [
starlight({
title: 'Example Docs',
editLink: { baseUrl: 'https://github.com/example/docs/edit/main/' },
sidebar: [
{ label: 'Start here', autogenerate: { directory: 'start' } },
{ label: 'Guides', autogenerate: { directory: 'guides' } },
{ label: 'API', autogenerate: { directory: 'api' } },
],
customCss: ['./src/styles/brand.css'],
}),
react(),
],
});
Measured Impact
Both builds ran on the same GitHub Actions runner; page metrics are Lighthouse 12 mobile medians over five runs of four templates; field INP comes from web-vitals beacons over two four-week windows with similar traffic (about 180,000 page views each).
| Metric | Docusaurus 3.8 | Starlight 0.34 | Change |
|---|---|---|---|
| Cold build (hyperfine, 5 runs) | 58 s | 27 s | −53% |
| Warm build, one page edited | 44 s | 12 s | −73% |
| Compressed JS, median page | 186 KB | 9 KB (41 KB on playground pages) | −95% |
| Lab LCP, simulated 4G | 2.0 s | 1.0 s | −50% |
| Field INP, p75 | 210 ms | 96 ms | −54% |
| Field LCP, p75 | 1.9 s | 1.3 s | −32% |
| Deploy artifact size | 92 MB | 38 MB | −59% |
The INP result is the one that mattered to the business: Search Console had flagged 312 URLs as "INP needs improvement" on mobile, and 28 days after launch that count was zero. The field breakdown is explained in Measuring INP on Static Sites with Real-User Monitoring.
Where Docusaurus Still Won
The comparison was not one-sided, and three things were genuinely harder on Starlight.
Versioning. The product kept two supported versions. On Docusaurus that was docs:version and a dropdown. On Starlight it became two branches, two deploys (/docs/ and /docs/v1/) and a custom Header override with a version switcher — about six hours of extra work, and a second build pipeline to maintain. Teams with four or more live versions should weigh that heavily; the Docusaurus approach is covered in Versioned Documentation with Docusaurus.
Plugin breadth. Docusaurus has a larger plugin catalogue: OpenAPI page generation, ideal-image, PWA, client redirects. Starlight's catalogue is growing but thinner, and the OpenAPI plugin needed configuration work to match the old output.
Blog. The changelog had been a Docusaurus blog with tags and an RSS feed. It moved to the starlight-blog community plugin, which worked but required restyling.
Authoring and Review After the Switch
Performance numbers convinced the engineering lead; the writers were convinced by what happened to their daily loop. Three changes stood out in the month after launch.
Faster local preview. astro dev started in 1.8 seconds against 11 seconds for docusaurus start, and hot reload on a Markdown save dropped from about 2.5 seconds to under half a second. For a writer saving forty times an hour, that is the difference between watching the preview and forgetting it exists.
Readable errors. The most common Docusaurus failure had been an MDX compile error caused by an unescaped < or { in prose — for example latency < 200ms or a JSON snippet outside a code fence. Starlight parses .md files as plain Markdown, so those characters simply render. The support team, who contribute about a quarter of all edits, stopped filing "the build is broken" tickets entirely; there had been eleven in the previous quarter.
Smaller review diffs. Autogenerated sidebars removed a class of pull request in which a writer added a page and forgot to register it in sidebars.js. Reviews became content-only, and median time from pull request to merge fell from 26 hours to 17 over the following six weeks, measured from the GitHub API.
None of this is exclusive to Starlight — a well-configured Docusaurus with format: 'detect' and autogenerated sidebars recovers part of it — but defaults matter because most teams never change them. If writer experience is a priority, audit the defaults with the same care as the build numbers, using the review workflow in Docs-as-Code Review Workflow for Writers as the baseline.
Search behaviour changed too. Pagefind loads index fragments on demand, so the first query on a page costs about 90 KB of downloads and returns in roughly 150 ms on a mid-range phone; Algolia had answered in about 60 ms from its API. Nobody noticed in usability sessions, but it is a measurable difference, and it is worth recording in the decision log so that a future complaint about search speed can be traced to a deliberate trade rather than a regression.
Pitfalls & Rollback
- Assuming admonitions port cleanly everywhere. Docusaurus's
:::note[Title]title syntax differs slightly from older Starlight releases; grep for:::with a bracket and test a sample. - Dropping redirects. Docusaurus's
/docs/prefix disappeared in the new URL scheme on the first attempt. Keep URLs identical or generate redirects as described in Keeping Redirects Working After an SSG Migration. - Hydrating everything. Wrapping every React component in
client:loadrecreates the Docusaurus JavaScript bill. Default to no directive; addclient:visibleonly to components that respond to input. - Losing search analytics. Moving from Algolia to Pagefind removes Algolia's query analytics. Log searches to your own endpoint if the support team relies on them.
- Rollback: run both sites in parallel behind the same domain during cutover, routing by path prefix at the CDN. Reverting is a routing change, and the old build stays deployable until the new one has four clean weeks of field data.
Conclusion
For this product's docs, Starlight halved build time, cut JavaScript by 95% and moved field INP from 210 ms to 96 ms, at the cost of hand-assembling versioning and a thinner plugin catalogue. That trade is right for most support-driven documentation with one or two live versions. For products with many supported versions, a built-in blog and a React-heavy design system, Docusaurus's integrated features still earn their runtime cost — especially with Rspack enabled to close the build-time gap.
FAQ
Is Starlight mature enough for a commercial product's docs?
For most product documentation, yes. It is pre-1.0, so minor releases can include breaking changes, but those are documented in the changelog and in our port each upgrade took under an hour. Pin exact versions and upgrade through a preview deploy.
When is Docusaurus clearly the better choice?
When you need several concurrently supported doc versions, a built-in blog, or deep integration with an existing React design system. Docusaurus handles versioning with one CLI command, which Starlight does not offer.
How much did field INP change after moving to Starlight?
The 75th-percentile INP from real-user monitoring fell from 210 ms on Docusaurus to 96 ms on Starlight over comparable four-week windows, because the pages stopped hydrating a full React tree.
Can Starlight use React components from our design system?
Yes. Add the Astro React integration and render components with a client directive only where they need interactivity. Static components render to HTML with no JavaScript shipped.
Related
- Parent: Docs Frameworks: Docusaurus, Starlight and VitePress — the three-way comparison.
- Versioned Documentation with Docusaurus — Docusaurus's strongest feature, done efficiently.
- Customizing Starlight Without Forking the Theme — the brand restyle from this port.
- Astro Islands vs Full Hydration Performance — why the JavaScript bill fell.
- Migrating from Hugo to Astro Without Breaking URLs — URL parity techniques that apply here too.