Getting Started
Install the Page theme, register it with Starlight, and render your first RefineUI component.
Page is a Starlight plugin. It replaces Starlight’s header, sidebar, search, table of contents, pagination, and footer with RefineUI, and it re-exports every RefineUI component so your pages can use the same parts.
1. Install
Section titled “1. Install”Add the theme, the React integration, and React. @astrojs/starlight is already in a Starlight project.
bun add @pelagornis/page @astrojs/react react react-domnpm install @pelagornis/page @astrojs/react react react-dompnpm add @pelagornis/page @astrojs/react react react-domyarn add @pelagornis/page @astrojs/react react react-domThe theme pulls in @refineui/react, @refineui/tokens, the icon font, and Tailwind. You don’t install them yourself.
2. Register the plugin
Section titled “2. Register the plugin”import { defineConfig } from "astro/config";import starlight from "@astrojs/starlight";import pagePlugin from "@pelagornis/page";
export default defineConfig({ integrations: [ starlight({ title: "My Docs", plugins: [ pagePlugin({ navigation: [{ href: "/guides/getting-started/", label: "Guide" }], }), ], }), ],});The plugin registers @astrojs/react and Tailwind for you. Don’t add react() to integrations a second time.
Options
Section titled “Options”| Option | Type | Use |
|---|---|---|
navigation |
NavigationItem[] |
Items in the center of the header. A link, or a dropdown. See Header navigation. |
footerText |
string |
Copyright line in the footer. |
siteTitle |
string |
Brand text in the header. Defaults to the Starlight title. |
breadcrumbs |
boolean |
Sidebar trail above each page title. Defaults to true. |
llmsTxt |
boolean | { title?, description?, details? } |
Writes llms.txt for AI tools at build time. Defaults to true. See llms.txt. |
skipComponents |
string[] |
Starlight slots that should keep the default Starlight component. See Shell overrides. |
Header navigation
Section titled “Header navigation”Each navigation item is a link or a dropdown. A dropdown lists items, or fills itself from a top-level sidebar group: name the group with sidebar, using the label as written in the Starlight config. A sidebar dropdown takes the group’s translated label, and lists the group’s pages and one link per nested group.
pagePlugin({ navigation: [ { label: "Blog", href: "/blog/", translations: { ko: "블로그" } }, { sidebar: "Guides" }, { label: "Resources", items: [ { label: "Changelog", href: "/changelog/", description: "What changed in each release" }, { label: "GitHub", href: "https://github.com/pelagornis/starlight-theme-page" }, ], }, ],});Dropdown links take a short description for the second line, a string or one per locale lang. The panel grows with its text, as RefineUI’s NavigationMenu sets only a minimum width, so keep descriptions to a few words. A sidebar dropdown describes each nested group by its first two pages. translations holds labels per locale lang. Links that start with / get the current locale prefix on translated pages.
llms.txt
Section titled “llms.txt”astro build writes three kinds of files for AI tools, from the rendered pages of the default locale:
/llms.txt: the project summary and every page in sidebar order, linked to its Markdown copy/llms-full.txt: every page in one file- a Markdown copy of each page at its URL with
.mdin place of the trailing slash, such as/guides/getting-started.md
Code examples, tables, and every tab of a tab set are kept. Live component previews are left out. To ship your own llms.txt or llms-full.txt, put it in public/ and the plugin leaves it as it is. Set llmsTxt: false to turn the files off.
3. Run the site
Section titled “3. Run the site”bun run devOpen http://localhost:4321/. The header, sidebar, search (⌘ K), and footer are now RefineUI.
4. Use a component in a page
Section titled “4. Use a component in a page”Every RefineUI component is exported from @pelagornis/page/components. Rename a page to .mdx and import what you need.
---title: Welcome---
import { Badge, Button } from "@pelagornis/page/components";
<Badge variant="success">Stable</Badge>
<Button variant="primary">Continue</Button>Components that only render markup work like this. Components that keep state, such as Tabs or Dialog, go in a .tsx file first. Use in MDX explains both cases, and Use in Markdoc covers .mdoc pages.
Styles
Section titled “Styles”The plugin injects the stylesheets the shell needs. A separate global.css import is not required.
- The
@pelagornis/pageTailwind entry with the RefineUI token theme - The RefineUI system icon font
@refineui/react/refineui.css- Chrome rules that map Starlight’s layout variables onto RefineUI tokens
Light and dark mode follow Starlight’s theme switch. RefineUI semantic tokens change with data-theme, so components and your own CSS that uses var(--refineui-color-alias-*) follow along.
- Browse all components with live previews.
- Read Use in MDX before composing interactive parts.