Documentation
¶
Overview ¶
Package components ships the Hearth shell's structural templ components: the parameterized Layout (264px sidebar plus main) and NavPill. Palette, PWA manifest wiring, and app-specific motion are deliberately NOT modeled here — see ShellProps's HeadExtras, SidebarBrand, SidebarExtra, and SidebarFooter slots, which are where each app injects that content.
templ: version: v0.3.1020
templ: version: v0.3.1020
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Layout ¶
Layout renders the Hearth shell — a fixed left sidebar plus the main content area — around content. Use it with the render seam, binding props and nav into the layout func:
layout := func(c templ.Component) templ.Component { return components.Layout(props, nav, c) }
render.Page(ctx, w, r, layout, content)
Types ¶
type NavItem ¶
type NavItem struct {
}
NavItem is a sidebar navigation entry. Active marks the current page.
type ShellProps ¶
type ShellProps struct {
// AppName renders in <title>, and in the sidebar brand row when
// SidebarBrand is nil.
AppName string
// FaviconHref is the favicon <link> target, e.g. "/static/favicon.svg".
// Empty renders no favicon link.
FaviconHref string
// ThemeColor sets the meta theme-color tag, e.g. "#6f8c6a". Empty
// renders no theme-color meta.
ThemeColor string
// StylesheetHref is the compiled Tailwind CSS bundle this app built from
// ui/css/theme.css plus its own palette (e.g. "/static/css/app.css").
StylesheetHref string
// HeadExtras renders after the HTMX script and before Alpine's — the
// position an app's own PWA manifest link, service worker registration,
// or Alpine-extension scripts (which must load before alpine.min.js;
// see ui/static's doc) need. Nil renders nothing.
HeadExtras templ.Component
// SidebarBrand renders the sidebar's brand row (logo mark plus name).
// Nil falls back to a plain AppName label.
SidebarBrand templ.Component
// SidebarExtra renders below primary nav — member/owner lists, a mini
// calendar, and similar per-app sidebar content. Nil renders nothing.
SidebarExtra templ.Component
// form, cross-app links, and similar). Nil renders nothing.
SidebarFooter templ.Component
}
ShellProps configures the Hearth shell (the fixed 264px sidebar plus main content area shared by every Hearth app). Token NAMES referenced by the shell's CSS are the same across apps; token VALUES, PWA identity, and motion scripts are each app's own and are injected through the slots below rather than modeled here.