layouts

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Overview

templ: version: v0.3.1001

Index

Constants

View Source
const (
	LayoutRoot      = "root"
	LayoutDashboard = "dashboard"
	LayoutSettings  = "settings"
	LayoutBase      = "base"
	LayoutFull      = "full"
	LayoutAuth      = "auth"
	LayoutExtension = "extension"
)

Layout name constants used for registration and route assignment.

Variables

This section is empty.

Functions

func AppGridEntryTempl added in v1.2.0

func AppGridEntryTempl(entry contributor.ExtensionEntry, activePath string) templ.Component

AppGridEntryTempl renders a single entry in the app grid navigator popover.

func AppGridNavigatorTempl added in v1.2.0

func AppGridNavigatorTempl(lm *LayoutManager, pageCtx *router.PageContext) templ.Component

AppGridNavigatorTempl renders the 6-dot grid icon button with a ForgeUI dropdown listing all extensions using the extension layout, plus the core dashboard.

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 ExtensionActionTempl added in v1.2.0

func ExtensionActionTempl(action contributor.TopbarAction) templ.Component

ExtensionActionTempl renders a custom action button in the extension topbar.

func ExtensionBrandingTempl added in v1.2.0

func ExtensionBrandingTempl(cfg resolvedTopbarConfig) templ.Component

ExtensionBrandingTempl renders the extension logo and title in the topbar.

func ExtensionLayoutTempl added in v1.2.0

func ExtensionLayoutTempl(lm *LayoutManager, pageCtx *router.PageContext, content templ.Component) templ.Component

ExtensionLayoutTempl renders the extension layout. When the extension's manifest has ShowSidebar enabled, it renders with a sidebar containing the extension's own nav items. Otherwise, it renders the standalone topbar-only 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 with a dropdown popover showing recent notifications. Uses ForgeUI dropdown component.

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 SearchDialogTempl added in v1.2.0

func SearchDialogTempl(basePath string) templ.Component

SearchDialogTempl renders the search command palette using ForgeUI dialog. Opens via Cmd+K or clicking the search trigger. Results fetched from /api/search. Uses window.tui.dialog API for open/close and a local Alpine x-data for search state.

func SearchTriggerTempl added in v1.0.0

func SearchTriggerTempl(enabled bool) templ.Component

SearchTriggerTempl renders the Cmd+K search button that opens the search dialog. Uses ForgeUI dialog API (window.tui.dialog.open) instead of Alpine store.

func SettingsLayoutTempl added in v1.0.0

func SettingsLayoutTempl(lm *LayoutManager, pageCtx *router.PageContext, content templ.Component) templ.Component

SettingsLayoutTempl renders settings content directly. Navigation is handled by the main dashboard sidebar's collapsible Settings section.

func SettingsSubNavTempl added in v1.0.0

func SettingsSubNavTempl(lm *LayoutManager, activePath string) templ.Component

SettingsSubNavTempl renders the settings sub-navigation sidebar.

func TenantIndicatorTempl added in v1.2.0

func TenantIndicatorTempl(tenant *dashauth.TenantInfo) templ.Component

TenantIndicatorTempl shows the current tenant context in the topbar.

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. Only renders for authenticated users. Sign-in is handled by the sidebar footer.

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.

func (*LayoutManager) SetAuthEnabled added in v1.2.0

func (lm *LayoutManager) SetAuthEnabled(enabled bool, loginPath, logoutPath string)

SetAuthEnabled updates the auth configuration at runtime. This is used for late auth registration when an auth provider registers after the layout manager has already been constructed.

func (*LayoutManager) SetFooterActions added in v1.2.0

func (lm *LayoutManager) SetFooterActions(actions []shell.UserDropdownAction)

SetFooterActions configures the user dropdown actions contributed by extensions implementing DashboardFooterContributor. Called during dashboard Start() after extension discovery.

Jump to

Keyboard shortcuts

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