Documentation
¶
Overview ¶
templ: version: v0.3.977
Index ¶
- Constants
- func AuthLayoutTempl(lm *LayoutManager, content templ.Component) templ.Component
- func BaseLayoutTempl(lm *LayoutManager, pageCtx *router.PageContext, content templ.Component) templ.Component
- func ConnectionIndicatorTempl(enabled bool) templ.Component
- func DashboardLayoutTempl(lm *LayoutManager, pageCtx *router.PageContext, content templ.Component) templ.Component
- func DashboardTopBar(lm *LayoutManager, pageCtx *router.PageContext) templ.Component
- func FullLayoutTempl(content templ.Component) templ.Component
- func NotificationBellTempl() templ.Component
- func RootLayoutTempl(lm *LayoutManager, pageCtx *router.PageContext, content templ.Component) templ.Component
- func SearchTriggerTempl(enabled bool) templ.Component
- func SettingsLayoutTempl(lm *LayoutManager, pageCtx *router.PageContext, content templ.Component) templ.Component
- func SettingsSubNavTempl(lm *LayoutManager, activePath string) templ.Component
- func ThemeToggleTempl() templ.Component
- func UserMenuTempl(lm *LayoutManager, pageCtx *router.PageContext) templ.Component
- type LayoutConfig
- type LayoutManager
Constants ¶
const ( LayoutRoot = "root" LayoutDashboard = "dashboard" LayoutSettings = "settings" LayoutBase = "base" LayoutFull = "full" LayoutAuth = "auth" )
Layout name constants used for registration and route assignment.
Variables ¶
This section is empty.
Functions ¶
func AuthLayoutTempl ¶ added in v1.0.0
func AuthLayoutTempl(lm *LayoutManager, content templ.Component) templ.Component
AuthLayoutTempl renders a centered card layout for authentication pages. No sidebar or topbar -- just a clean centered container with a brand link and theme toggle.
func BaseLayoutTempl ¶ added in v1.0.0
func BaseLayoutTempl(lm *LayoutManager, pageCtx *router.PageContext, content templ.Component) templ.Component
BaseLayoutTempl renders a minimal layout: topbar with brand link and breadcrumbs, followed by the main content area. No sidebar.
func ConnectionIndicatorTempl ¶ added in v1.0.0
ConnectionIndicatorTempl shows SSE/realtime connection status via Alpine.
func DashboardLayoutTempl ¶ added in v1.0.0
func DashboardLayoutTempl(lm *LayoutManager, pageCtx *router.PageContext, content templ.Component) templ.Component
DashboardLayoutTempl renders the primary dashboard chrome: a collapsible sidebar with navigation groups on the left, and a SidebarInset (topbar + content area) on the right.
func DashboardTopBar ¶ added in v1.0.0
func DashboardTopBar(lm *LayoutManager, pageCtx *router.PageContext) templ.Component
DashboardTopBar renders the topbar header for the dashboard layout.
func FullLayoutTempl ¶ added in v1.0.0
FullLayoutTempl renders content with no chrome at all -- just a minimal background wrapper and an HTMX-targetable main element.
func NotificationBellTempl ¶ added in v1.0.0
NotificationBellTempl renders the notification bell icon with unread count badge.
func RootLayoutTempl ¶ added in v1.0.0
func RootLayoutTempl(lm *LayoutManager, pageCtx *router.PageContext, content templ.Component) templ.Component
RootLayoutTempl renders the full HTML document shell. When the request is a partial HTMX navigation (HX-Request without HX-Boosted), only the inner content is returned so HTMX can swap it into the existing page.
func SearchTriggerTempl ¶ added in v1.0.0
SearchTriggerTempl renders the Cmd+K search button.
func SettingsLayoutTempl ¶ added in v1.0.0
func SettingsLayoutTempl(lm *LayoutManager, pageCtx *router.PageContext, content templ.Component) templ.Component
SettingsLayoutTempl wraps content with a settings sub-navigation panel. Its parent is DashboardLayout, so it already has the sidebar and topbar.
func SettingsSubNavTempl ¶ added in v1.0.0
func SettingsSubNavTempl(lm *LayoutManager, activePath string) templ.Component
SettingsSubNavTempl renders the settings sub-navigation sidebar.
func ThemeToggleTempl ¶ added in v1.0.0
ThemeToggleTempl renders a dark/light mode toggle button using Alpine.js.
func UserMenuTempl ¶ added in v1.0.0
func UserMenuTempl(lm *LayoutManager, pageCtx *router.PageContext) templ.Component
UserMenuTempl renders an auth-aware user dropdown in the topbar. When authenticated: shows user avatar/initials + dropdown with sign-out. When not authenticated + auth enabled: shows a "Sign in" link. When auth is disabled: renders nothing.
Types ¶
type LayoutConfig ¶
type LayoutConfig struct {
Title string
CustomCSS string
BridgeEndpoint string
EnableBridge bool
EnableSearch bool
EnableRealtime bool
EnableAuth bool
LoginPath string
LogoutPath string
}
LayoutConfig holds configuration for all dashboard layouts.
type LayoutManager ¶
type LayoutManager struct {
// contains filtered or unexported fields
}
LayoutManager registers and manages all dashboard layouts with forgeui.
func NewLayoutManager ¶
func NewLayoutManager(fuiApp *forgeui.App, basePath string, registry *contributor.ContributorRegistry, config LayoutConfig) *LayoutManager
NewLayoutManager creates a LayoutManager and registers all layouts with the forgeui application. The "dashboard" layout is set as the default.