Plugin API
Type-level reference for the @grove-dev/starlight plugin used by Grove docs.
Import
Section titled “Import”import grove from '@grove-dev/starlight';The plugin’s default export is also still importable as
lucodefor back-compat with V0 docs that pre-date the Grove rebrand. New code should import asgrove.
Use the default export inside Starlight’s plugins array:
starlight({ plugins: [grove()],});GroveStarlightUserConfig
Section titled “GroveStarlightUserConfig”type GroveStarlightUserConfig = { navLinks?: Link[]; docs?: { includeAiUtilities?: boolean }; footerText?: string; warnOverrides?: boolean;};
/** @deprecated Use GroveStarlightUserConfig. */type LucodeStarlightUserConfig = GroveStarlightUserConfig;navLinks
Section titled “navLinks”Header navigation links rendered by the theme.
type Link = { label: string | Record<string, string>; link: string; badge?: string; attrs?: Record<string, string | number | boolean | undefined>;};grove({ navLinks: [ { label: 'Docs', link: '/guides/getting-started/' }, { label: 'API', link: '/reference/plugin-api/' }, { label: 'GitHub', link: 'https://github.com/tortuvshin/grove', attrs: { target: '_blank', rel: 'noreferrer' }, }, ],});footerText
Section titled “footerText”Markdown rendered in the footer text slot.
grove({ footerText: 'Built by [grove](https://github.com/tortuvshin/grove). Released under the MIT License.',});If omitted, the theme uses its built-in credit line.
docs.includeAiUtilities
Section titled “docs.includeAiUtilities”Toggles a per-page AI utilities menu (ChatGPT and Claude) in the page header.
grove({ docs: { includeAiUtilities: true },});Frontmatter Extension
Section titled “Frontmatter Extension”Import ExtendDocsSchema from @grove-dev/starlight/schema and pass it to Starlight’s docsSchema().
import { ExtendDocsSchema } from '@grove-dev/starlight/schema';
schema: docsSchema({ extend: ExtendDocsSchema });The extension adds:
type GroveDocsFrontmatter = { links?: { doc?: string; api?: string; }; hero?: { layout?: 'centered' | 'centered-top' | 'split-left' | 'split-right' | 'banner'; announcement?: { text: string; link: string }; shadcn?: { actions: ShadcnAction[] }; };};
/** @deprecated Use GroveDocsFrontmatter. */type LucodeDocsFrontmatter = GroveDocsFrontmatter;
type ShadcnAction = { text: string; link: string; variant?: 'default' | 'link' | 'secondary' | 'outline' | 'ghost' | 'destructive'; icon?: string; attrs?: Record<string, string | number | boolean>;};hero.layout defaults to centered.
Package Exports
Section titled “Package Exports”import lucode from '@grove-dev/starlight';import { ExtendDocsSchema } from '@grove-dev/starlight/schema';import { ContainerSection, LinkButton } from '@grove-dev/starlight/components';The package also exports the internal Starlight override components and CSS files for advanced composition:
@grove-dev/starlight/styles/layers@grove-dev/starlight/styles/theme@grove-dev/starlight/styles/base@grove-dev/starlight/components/overrides/Header.astro@grove-dev/starlight/components/overrides/Hero.astro@grove-dev/starlight/components/overrides/Footer.astro
Prefer the plugin for normal sites. Reach for direct exports only when you are building a custom integration or intentionally composing with one of the theme overrides.
Grove Theme Wiring
Section titled “Grove Theme Wiring”@grove-dev/docs enables the Grove Starlight plugin with this configuration:
starlight({ title: 'Grove', customCss: ['./src/styles/global.css'], lastUpdated: true, editLink: { baseUrl: 'https://github.com/tortuvshin/grove/edit/main/docs' }, plugins: [ grove({ docs: { includeAiUtilities: true }, navLinks: [ { label: 'Docs', link: '/guides/getting-started/' }, { label: 'Showcase', link: '/showcase/starlight-components/' }, { label: 'GitHub', link: 'https://github.com/tortuvshin/grove' }, ], }), ], sidebar: [ /* ... */ ],});If you fork the docs site, replace the GitHub links and the repo path on editLink.baseUrl.