| name | starlight |
| version | 1.0.0 |
| description | Starlight - Full-featured documentation theme built on Astro for creating beautiful, accessible, high-performance documentation websites with built-in search, i18n, and customizable components |
Starlight Skill
Starlight is a full-featured documentation theme built on top of the Astro framework. It provides everything needed to create professional documentation sites with minimal configuration - from built-in search and internationalization to customizable components and dark mode support.
Key Value Proposition: Build beautiful, accessible, high-performance documentation websites with Astro's speed and Starlight's comprehensive feature set. Used by 10,300+ projects with 7,700+ GitHub stars.
When to Use This Skill
- Creating documentation websites for projects, APIs, or products
- Building technical documentation with code examples and syntax highlighting
- Setting up multilingual documentation sites with i18n support
- Developing landing pages with splash templates
- Implementing searchable documentation with Pagefind integration
- Customizing documentation themes with CSS or Tailwind
- Migrating existing docs to a modern static site generator
- Creating developer portals or knowledge bases
When NOT to Use This Skill
- For blog-focused sites (use Astro's blog template instead)
- For e-commerce or dynamic web applications (use full-stack frameworks)
- For single-page applications requiring client-side routing (use React/Vue/Svelte)
- For sites requiring server-side rendering on every request (use Next.js/Nuxt)
- For non-documentation content-heavy sites (use general Astro templates)
Core Concepts
Architecture Overview
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Starlight Site โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Content Layer โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
โ โ Markdown โ โ MDX โ โ Markdoc โ โ Frontmatter โ โ
โ โ (.md) โ โ (.mdx) โ โ (.mdoc) โ โ (YAML) โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Starlight Features โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
โ โ Sidebar โ โ Search โ โ i18n โ โ Components โ โ
โ โNavigationโ โ(Pagefind)โ โ (20+lang)โ โ (Tabs,Cards) โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Astro Build โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Static HTML + CSS + Optimized Assets + Sitemap + RSS โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Deployment โ
โ Vercel | Netlify | Cloudflare Pages | GitHub Pages | Static โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Technology Stack
| Layer | Technology | Purpose |
|---|
| Framework | Astro | Static site generation with island architecture |
| Content | Markdown/MDX/Markdoc | Documentation authoring formats |
| Styling | CSS/Tailwind | Custom theming and styling |
| Search | Pagefind | Client-side full-text search |
| i18n | Built-in | 20+ language translations |
| Syntax Highlighting | Expressive Code | Code blocks with line highlighting |
| Components | Astro Components | Reusable UI elements |
| Build | Vite | Fast development and production builds |
Installation
Prerequisites
- Node.js 18.17.1 or 20.3.0 or higher (v19 not supported)
- npm, pnpm, or Yarn package manager
Quick Start
npm create astro@latest -- --template starlight
pnpm create astro --template starlight
yarn create astro --template starlight
With Tailwind CSS
npm create astro@latest -- --template starlight/tailwind
With Markdoc
npm create astro@latest -- --template starlight/markdoc
Development Server
npm run dev
pnpm dev
yarn dev
The development server starts at http://localhost:4321 with hot reload.
Build for Production
npm run build
npm run preview
Project Structure
my-docs/
โโโ public/
โ โโโ favicon.svg # Static favicon
โ
โโโ src/
โ โโโ assets/
โ โ โโโ logo.svg # Site logo
โ โ
โ โโโ components/
โ โ โโโ CustomCard.astro # Custom components
โ โ
โ โโโ content/
โ โ โโโ docs/ # Documentation pages
โ โ โ โโโ index.mdx # Homepage
โ โ โ โโโ getting-started.md
โ โ โ โโโ guides/
โ โ โ โโโ 01-installation.md
โ โ โ โโโ 02-configuration.md
โ โ โ
โ โ โโโ i18n/ # Translation files (optional)
โ โ โ โโโ ar.json
โ โ โ โโโ zh-CN.json
โ โ โ
โ โ โโโ content.config.ts # Content collection config
โ โ
โ โโโ styles/
โ โโโ custom.css # Custom styles
โ
โโโ astro.config.mjs # Astro + Starlight configuration
โโโ package.json
โโโ tsconfig.json
Configuration
Basic Configuration
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
export default defineConfig({
integrations: [
starlight({
title: 'My Documentation',
description: 'Learn how to use our product',
logo: {
src: './src/assets/logo.svg',
replacesTitle: true,
},
social: [
{ icon: 'github', label: 'GitHub', href: 'https://github.com/user/repo' },
{ icon: 'discord', label: 'Discord', href: 'https://discord.gg/...' },
],
editLink: {
baseUrl: 'https://github.com/user/repo/edit/main/',
},
customCss: ['./src/styles/custom.css'],
sidebar: [
{ slug: 'getting-started' },
{
: ,
: { : },
},
{
: ,
: [
{ : },
{ : , : },
],
},
],
}),
],
});
Sidebar Configuration
sidebar: [
{ slug: 'introduction' },
{
label: 'Getting Started',
items: [
{ slug: 'installation' },
{ slug: 'configuration' },
],
},
{
label: 'Guides',
autogenerate: { directory: 'guides' },
collapsed: true,
},
{
slug: 'api-reference',
badge: { text: 'New', variant: 'tip' },
},
{
label: 'Resources',
translations: { 'pt-BR': 'Recursos' },
items: [...],
},
]
Logo Variants (Light/Dark)
logo: {
light: './src/assets/logo-light.svg',
dark: './src/assets/logo-dark.svg',
alt: 'My Project Logo',
}
Table of Contents
tableOfContents: {
minHeadingLevel: 2,
maxHeadingLevel: 3
}
tableOfContents: false
Authoring Content
Frontmatter Options
---
title: Page Title
description: SEO description for the page
slug: custom-url-path
template: doc
tableOfContents: false
hero:
title: Welcome to My Docs
tagline: Beautiful documentation made easy
image:
file: ../../assets/hero.png
alt: Hero illustration
actions:
- text: Get Started
link: /getting-started/
icon: right-arrow
variant: primary
- text: View on GitHub
Markdown Formatting
## Headings (H2-H6)
**Bold text** and *italic text* and ~~strikethrough~~
`inline code` for technical terms
[Internal link](/guides/setup/)
[External link](https://example.com)
> Blockquote for important notes
- Unordered list
- Another item
1. Ordered list
2. Second item
Asides (Callouts)
:::note
This is a note callout for general information.
:::
:::tip
Helpful tips and best practices go here.
:::
:::caution
Warnings about potential issues.
:::
:::danger
Critical warnings about breaking changes or security issues.
:::
:::tip[Custom Title]
You can customize the callout title.
:::
Code Blocks with Expressive Code
```javascript title="config.js"
// Basic code block with title
export const config = {
name: 'My App',
};
function example() {
const highlighted = true;
const alsoHighlighted = true;
const inserted = 'new line';
const deleted = 'old line';
}
npm install @astrojs/starlight
### Details/Accordion
```html
<details>
<summary>Click to expand</summary>
This content is hidden by default.
You can include **Markdown** formatting inside.
</details>
Built-in Components
Importing Components
---
title: Using Components
---
import { Tabs, TabItem, Card, CardGrid, LinkCard, Badge, Icon, Steps, FileTree } from '@astrojs/starlight/components';
Tabs
<Tabs>
<TabItem label="npm">
```bash
npm install package
```
</TabItem>
<TabItem label="pnpm">
```bash
pnpm add package
```
</TabItem>
<TabItem label="yarn">
```bash
yarn add package
```
</TabItem>
</Tabs>
Cards and Card Grids
<CardGrid>
<Card title="Getting Started" icon="rocket">
Learn the basics of setting up your project.
</Card>
<Card title="Configuration" icon="setting">
Customize your documentation site.
</Card>
</CardGrid>
<LinkCard
title="View on GitHub"
description="Check out the source code"
href="https://github.com/user/repo"
/>
Steps
<Steps>
1. Install the package
```bash
npm install my-package
-
Configure your project
Add the configuration to your file.
-
Start building
You're ready to go!
```
File Tree
<FileTree>
- src/
- components/
- Header.astro
- Footer.astro
- content/
- docs/
- index.md
- **getting-started.md** (highlighted)
- styles/
- global.css
- astro.config.mjs
- package.json
</FileTree>
Badges
<Badge text="New" variant="tip" />
<Badge text="Deprecated" variant="caution" />
<Badge text="v2.0" variant="note" />
Icons
<Icon name="star" />
<Icon name="rocket" size="1.5rem" />
<Icon name="github" />
Internationalization (i18n)
Configuration
starlight({
title: 'My Docs',
defaultLocale: 'en',
locales: {
root: {
label: 'English',
lang: 'en',
},
'zh-cn': {
label: '็ฎไฝไธญๆ',
lang: 'zh-CN',
},
ar: {
label: 'ุงูุนุฑุจูุฉ',
dir: 'rtl',
},
pt: {
label: 'Portuguรชs',
lang: 'pt-BR',
},
},
})
Directory Structure for i18n
src/content/docs/
โโโ index.md # English (root locale)
โโโ getting-started.md
โโโ zh-cn/
โ โโโ index.md # Chinese
โ โโโ getting-started.md
โโโ ar/
โ โโโ index.md # Arabic
โ โโโ getting-started.md
โโโ pt/
โโโ index.md # Portuguese
โโโ getting-started.md
Translating UI Strings
import { defineCollection } from 'astro:content';
import { docsLoader, i18nLoader } from '@astrojs/starlight/loaders';
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
export const collections = {
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
i18n: defineCollection({ loader: i18nLoader(), schema: i18nSchema() }),
};
{
"search.label": "ๆ็ดข",
"tableOfContents.onThisPage": "ๆฌ้กต็ฎๅฝ",
"i18n.untranslatedContent": "ๆญคๅ
ๅฎนๅฐๆช็ฟป่ฏใ"
}
Multilingual Title
title: {
en: 'My Documentation',
'zh-CN': 'ๆ็ๆๆกฃ',
ar: 'ูุซุงุฆูู',
}
Styling and Customization
Custom CSS
:root {
--sl-color-accent-low: #1e1b4b;
--sl-color-accent: #4f46e5;
--sl-color-accent-high: #a5b4fc;
--sl-color-text-accent: #818cf8;
--sl-font: 'Inter', sans-serif;
--sl-font-mono: 'Fira Code', monospace;
--sl-content-width: 50rem;
}
:root[data-theme='dark'] {
--sl-color-accent-low: #312e81;
--sl-color-accent: #6366f1;
}
Custom Fonts
customCss: [
'@fontsource/inter/400.css',
'@fontsource/inter/600.css',
'@fontsource/fira-code/400.css',
'./src/styles/custom.css',
]
:root {
--sl-font: 'Inter', sans-serif;
--sl-font-mono: 'Fira Code', monospace;
}
Tailwind CSS Integration
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
integrations: [
starlight({
title: 'Docs with Tailwind',
customCss: ['./src/styles/tailwind.css'],
}),
],
vite: {
plugins: [tailwindcss()],
},
});
@layer base, starlight, theme, components, utilities;
@import '@astrojs/starlight-tailwind';
@import 'tailwindcss/theme.css' layer(theme);
@import 'tailwindcss/utilities.css' layer(utilities);
Overriding Components
Replace a Component
starlight({
title: 'My Docs',
components: {
Footer: './src/components/CustomFooter.astro',
SocialIcons: './src/components/MySocialLinks.astro',
},
})
Custom Component with Original
---
// src/components/CustomFooter.astro
import DefaultFooter from '@astrojs/starlight/components/Footer.astro';
---
<DefaultFooter>
<slot />
</DefaultFooter>
<div class="custom-footer-addition">
<p>Built with Starlight</p>
</div>
Conditional Rendering
---
// src/components/ConditionalFooter.astro
import Default from '@astrojs/starlight/components/Footer.astro';
const isHomepage = Astro.locals.starlightRoute.id === '';
---
{isHomepage ? (
<footer class="custom-homepage-footer">
<p>Welcome to our documentation!</p>
</footer>
) : (
<Default><slot /></Default>
)}
Available Override Points
| Component | Location |
|---|
Header | Site header with logo and navigation |
Footer | Page footer |
Sidebar | Sidebar navigation |
PageTitle | Page title component |
TableOfContents | Right sidebar table of contents |
SocialIcons | Social media links |
Search | Search component |
ThemeSelect | Dark/light mode toggle |
LanguageSelect | Language switcher |
PageFrame | Overall page layout |
TwoColumnContent | Main content area |
Deployment
Vercel
npm i -g vercel
vercel
Netlify
npm i -g netlify-cli
netlify deploy --prod
Cloudflare Pages
npm run build
wrangler pages deploy ./dist
GitHub Pages
name: Deploy to GitHub Pages
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run build
- uses: actions/upload-pages-artifact@v3
with:
path: ./dist
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Static Hosting with Base Path
export default defineConfig({
site: 'https://user.github.io',
base: '/my-repo/',
integrations: [starlight({ title: 'My Docs' })],
});
Troubleshooting
Common Issues
Build fails with content collection error:
rm -rf .astro
npm run build
Styles not updating in development:
npm run dev -- --force
Search not working:
npm run build
i18n pages not found:
- Verify directory structure matches locale configuration
- Check that
defaultLocale matches your root content
Components not importing:
Updating Starlight
npx @astrojs/upgrade
pnpm dlx @astrojs/upgrade
Resources
Official Documentation
Community
Examples
Related Technologies
Version History
- 1.0.0 (2026-01-12): Initial skill release
- Complete Starlight documentation framework coverage
- Installation and project structure
- Configuration options (sidebar, i18n, customization)
- Content authoring (frontmatter, Markdown, MDX)
- Built-in components (Tabs, Cards, Steps, FileTree)
- Internationalization with 20+ languages
- CSS and Tailwind styling
- Component overriding
- Deployment guides
- Troubleshooting