layouts

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

templ: version: v0.3.977

Index

Constants

View Source
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

func ConnectionIndicatorTempl(enabled bool) templ.Component

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

func FullLayoutTempl(content templ.Component) templ.Component

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

func NotificationBellTempl() templ.Component

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

func SearchTriggerTempl(enabled bool) templ.Component

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

func ThemeToggleTempl() templ.Component

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL