Skip to content

templates core

GitHub Actions edited this page Sep 17, 2026 · 1 revision

templates/core

Import: import { createCoreTemplate } from "@tundralibs/ui/templates/core"

Functions

createCoreTemplate

createCoreTemplate(options = : CoreOptions): RapidTemplate

Builds the document shell — Application.initialize({ ui: { core: createCoreTemplate({...}) } }). Head/meta/viewport, this library's assets (CDN or self-hosted), a skip-link and the toast region.

Types

CoreAssets

Where the document shell loads ui.css / ui.js from.

  • "cdn" (default): the versioned jsDelivr URLs from version.ts, with subresource integrity — zero setup, one fewer thing to serve.

  • A URL prefix such as "/ui": self-hosted. The app mounts the package's dist/ there (server.static: { "/ui": { root, fingerprint: true } }, see copyUiAssets() in @tundralibs/ui/assets) and every URL goes through view.asset() for cache-busting (§8).

  • "cdn"

  • /${string}

CoreOptions

Prop Type Required Description
assets CoreAssets
lang string <html lang>. @default "en"
stylesheets typeOperator Extra stylesheets after ui.css — a theme override file, fonts. A path starting with / is passed through view.asset(); anything else (a full URL) is used verbatim.
scripts typeOperator Extra scripts after ui.js, same path rules as stylesheets. An object form carries a subresource-integrity hash for a third-party CDN script (e.g. APEXCHARTS from @tundralibs/ui/chart).
head Html Extra <head> markup (preconnects, icons) — constant, not per-request.
toastRegion boolean Render the shared ToastRegion every page gets. @default true
history boolean Also load rAPId's opt-in history module (/__rapid/history.js) — pair with ui: { history: true }. @default false
live boolean Also load rAPId's live bridge (/__rapid/live.js) — pair with ui: { live: true }. @default false

Constants

  • CoreTemplate: RapidTemplate — The zero-config shell: assets from the versioned CDN.

Clone this wiki locally