@northstar/theme-default (0.2.3)

Published 2026-06-19 03:27:23 +00:00 by stephen

Installation

@northstar:registry=
npm install @northstar/theme-default@0.2.3
"@northstar/theme-default": "0.2.3"

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:

  • resolvePageLayout resolves layout IDs in this order: frontmatter.layout → collection layout → publication layout → content-type floor.
  • The content-type floor is article only for type: article, otherwise doc by 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.1

Peer dependencies

ID Version
@northstar/core 0.2.1
svelte ^5.0.0
Details
npm
2026-06-19 03:27:23 +00:00
54
MIT
latest
47 KiB
Assets (1)
Versions (10) View all
0.2.3 2026-06-19
0.2.2 2026-06-19
0.2.1 2026-06-18
0.2.0 2026-06-18
0.1.5 2026-06-17