Documentation
¶
Overview ¶
templ: version: v0.3.1020
Package ui is the Bespoke design system (docs/adr/0010-templui-component-base.md): templUI components vendored under components/ (never hand-edited — see CLAUDE.md), the compiled theme + JS under assets/ (embedded), and Bespoke wrapper components in shell.templ.
Regenerate after changing any .templ file or design/input.css:
scripts/build-ui.sh
Index ¶
- func AppIcon(name, class string) templ.Component
- func AppShell(p ShellProps) templ.Component
- func Handler() http.Handler
- func IntentConfirm(user auth.User, appTitle, intentTitle, prompt, action, text string) templ.Component
- func Markdown(src string) templ.Component
- func NotificationChrome() templ.Component
- func NotificationCount(n int) templ.Component
- func NotificationList(items []events.Notification) templ.Component
- func NotificationToasts(n *events.Notification) templ.Component
- func VoiceButton(action string) templ.Component
- func WithShellData(ctx context.Context, d ShellData) context.Context
- type AppLink
- type IntentLink
- type ShellData
- type ShellProps
- type ShellWidth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppIcon ¶
AppIcon renders a Lucide icon by name, falling back to a generic icon for names the vendored set doesn't know (manifest icons are free-text).
func AppShell ¶
func AppShell(p ShellProps) templ.Component
func Handler ¶
Handler serves the design system's compiled CSS and JS. pkg/web mounts it at /_bespoke/ on every app, outside auth (static assets, tailnet-only).
func IntentConfirm ¶
func Markdown ¶
Markdown renders user- or LLM-authored markdown (entries, summaries, notes) as styled HTML. Typography comes from the design system's `prose` styles (design/input.css).
func NotificationChrome ¶ added in v0.13.0
func NotificationCount ¶ added in v0.13.0
func NotificationList ¶ added in v0.13.0
func NotificationList(items []events.Notification) templ.Component
func NotificationToasts ¶ added in v0.13.0
func NotificationToasts(n *events.Notification) templ.Component
func VoiceButton ¶
Types ¶
type AppLink ¶
type AppLink struct {
Name string
Slug string
Icon string // Lucide name from the manifest
URL string // dev-aware: localhost:<port> or https://<slug>.<domain>
}
AppLink is one entry in the AppShell's app switcher.
type IntentLink ¶
type IntentLink struct {
App string // target app slug
Name string // intent name within that app
Title string // "Create Todo"
URL string // absolute confirm-page URL (append ?text=…)
}
IntentLink is another app's declared intent, resolved to an invokable URL (ADR-0018). The chrome's selection popover and app-level follow-ups (ui.IntentsFrom) both consume these.
func IntentsFrom ¶
func IntentsFrom(ctx context.Context) []IntentLink
IntentsFrom exposes foreign intents to app views for event-driven follow-ups (e.g. todo's "Journal it?" banner). Returns nil when none.
type ShellData ¶
type ShellData struct {
Apps []AppLink
Current string // slug of the running app; "" for platformd
HomeURL string
ChatEnabled bool
Intents []IntentLink // other apps' intents (never the current app's)
}
ShellData is platform chrome state, stashed in the request context by pkg/web's middleware (ADR-0015) so AppShell renders it with zero app code.
type ShellProps ¶
type ShellProps struct {
// Title is the app's display name; empty for the dashboard itself.
Title string
User auth.User
// Width controls the maximum width of the shared header and page content.
// The zero value preserves the reading-width layout used by existing apps.
Width ShellWidth
}
type ShellWidth ¶ added in v0.4.0
type ShellWidth string
ShellWidth lets an app choose the amount of horizontal space its views may use without giving up AppShell's platform chrome or mobile-first behavior.
const ( ShellWidthReading ShellWidth = "reading" ShellWidthWide ShellWidth = "wide" ShellWidthFull ShellWidth = "full" )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
components
|
|
|
icon
templui component icon - version: v1.12.1 installed by templui v1.12.1 📚 Documentation: https://templui.io/docs/components/icon
|
templui component icon - version: v1.12.1 installed by templui v1.12.1 📚 Documentation: https://templui.io/docs/components/icon |
|
templui util templui.go - version: v1.12.1 installed by templui v1.12.1
|
templui util templui.go - version: v1.12.1 installed by templui v1.12.1 |