@northstar/theme-default (0.2.1)
Published 2026-06-18 15:21:37 +00:00 by stephen
Installation
@northstar:registry=npm install @northstar/theme-default@0.2.1"@northstar/theme-default": "0.2.1"About this package
@northstar/theme-default
The default Northstar theme: layout, navigation, search UI, and the built-in component library (Callout, Tabs, Steps, CodeGroup, Card, ApiMethod, Mermaid, and more).
Part of Northstar. MIT licensed.
Layout contract
The theme exposes a shared resolver for selecting page layouts:
resolvePageLayoutresolves layout IDs in this order:frontmatter.layout→ collection layout → publication layout → content-type floor.- The content-type floor is
articleonly fortype: article, otherwisedocby default. - Unknown layout IDs that are not in the supplied layout map are ignored.
import { resolvePageLayout, type LayoutResolverInput } from '@northstar/theme-default';
const result = resolvePageLayout({
frontmatter: { layout: 'home' },
contentType: 'doc',
collectionName: 'docs',
collections: site.config.collections,
publications: site.config.publications,
layouts: {
home: HomeLayout,
article: ArticleLayout,
doc: DocLayout,
dashboard: DashboardLayout,
},
});
// result.id -> "home"
// result.component -> HomeLayout
Swizzle / third-party overrides
Themes and swizzled routes should pass their own registry in layouts.
Registering the same id replaces the default component, and adding new ids extends
the valid set. This keeps publication-aware dispatch centralized and reusable
across first-party and third-party themes.
Dependencies
Dependencies
| ID | Version |
|---|---|
| @northstar/ai | 0.2.0 |
| @northstar/search | 0.2.0 |
Peer dependencies
| ID | Version |
|---|---|
| @northstar/core | 0.2.0 |
| svelte | ^5.0.0 |