shell

package
v1.3.1 Latest Latest
Warning

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

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

Documentation

Overview

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthRedirectScript added in v0.10.0

func AuthRedirectScript() templ.Component

AuthRedirectScript handles HTMX 401 responses by reading the HX-Redirect header and performing a full-page redirect to the login page.

func BreadcrumbsNav(crumbs []Breadcrumb, basePath string) templ.Component

BreadcrumbsNav renders a breadcrumb navigation trail.

func ConnectionIndicator added in v1.0.0

func ConnectionIndicator() templ.Component

ConnectionIndicator shows SSE connection status.

func DashboardStoreScript

func DashboardStoreScript(basePath string) templ.Component

DashboardStoreScript initializes the Alpine.js store for dashboard state management.

func ForgeUIExtensionSidebar added in v1.2.0

func ForgeUIExtensionSidebar(cfg ExtensionSidebarConfig) templ.Component

ForgeUIExtensionSidebar builds a sidebar for an extension layout. Header shows the extension's icon and name with a link back to the extension root. Content shows the extension's nav groups. Footer shows user dropdown or "Back to Dashboard".

func ForgeUISidebar added in v1.0.0

func ForgeUISidebar(cfg SidebarConfig) templ.Component

ForgeUISidebar builds a full forgeui sidebar from a SidebarConfig. Uses CollapsibleIcon mode (collapses to icon-only) with VariantFloating style, collapsible sub-menus for items with children, and an auth-aware user dropdown footer.

func HTMXConfigScript

func HTMXConfigScript() templ.Component

HTMXConfigScript configures HTMX behavior for the dashboard.

func HTMXScript

func HTMXScript() templ.Component

HTMXScript returns the HTMX CDN script tag.

func HelperScripts

func HelperScripts() templ.Component

HelperScripts provides utility JavaScript functions used throughout the dashboard.

func NotificationBell added in v1.0.0

func NotificationBell(basePath string) templ.Component

NotificationBell renders the notification bell with unread count.

func SSEClientScript added in v1.2.0

func SSEClientScript(basePath string) templ.Component

SSEClientScript establishes the SSE connection and forwards events to Alpine.

func SanitizeAlpineKey

func SanitizeAlpineKey(name string) string

SanitizeAlpineKey converts a group name to a valid Alpine.js variable name.

func SearchKeyboardScript added in v1.2.0

func SearchKeyboardScript() templ.Component

SearchKeyboardScript adds Cmd+K / Ctrl+K keyboard shortcut to open search.

func SearchTrigger added in v1.0.0

func SearchTrigger() templ.Component

SearchTrigger renders the Cmd+K search button placeholder.

func ThemeToggle added in v1.0.0

func ThemeToggle() templ.Component

ThemeToggle renders a dark/light mode toggle button.

func TopBarComponent added in v1.0.0

func TopBarComponent(title string, breadcrumbs []Breadcrumb, basePath string) templ.Component

TopBarComponent renders the top bar with breadcrumbs, search trigger, notifications, and theme toggle.

Types

type Breadcrumb struct {
	Label string
	Path  string // empty = current page (no link)
}

Breadcrumb represents a single breadcrumb navigation item.

type ExtensionSidebarConfig added in v1.2.0

type ExtensionSidebarConfig struct {
	Groups                 []contributor.NavGroup
	ActivePath             string
	BasePath               string          // dashboard base path
	DashboardPath          string          // path to navigate back to dashboard
	ExtensionName          string          // extension display name
	ExtensionIcon          string          // lucide icon name
	ExtensionLogoURL       string          // custom logo URL (overrides ExtensionIcon)
	ExtensionIconComponent templ.Component // custom icon component (highest priority, from DashboardIconProvider)
	ExtensionBasePath      string          // extension entry point URL

	// Auth-related fields for the sidebar footer.
	EnableAuth bool
	User       *dashauth.UserInfo
	LoginPath  string
	LogoutPath string

	// UserDropdownActions are additional actions shown in the user dropdown.
	UserDropdownActions []UserDropdownAction

	// HeaderExtraContent is custom content rendered in the sidebar header
	// below the extension branding. Used for app switchers, status indicators, etc.
	HeaderExtraContent templ.Component

	// FooterExtraContent is custom content rendered in the sidebar footer
	// above the user dropdown. Used for links like API Docs, support, etc.
	FooterExtraContent templ.Component
}

ExtensionSidebarConfig holds all data needed to render an extension's sidebar.

type SidebarConfig added in v1.0.0

type SidebarConfig struct {
	Groups     []contributor.NavGroup
	ActivePath string
	BasePath   string

	// Auth-related fields for the sidebar footer.
	EnableAuth bool
	User       *dashauth.UserInfo
	LoginPath  string // full path shown in footer when not authenticated
	LogoutPath string // full path, e.g. "/dashboard/auth/logout"

	// UserDropdownActions are additional actions shown in the user dropdown
	// between the user info and the "Sign out" item. Contributed by extensions
	// implementing DashboardFooterContributor.
	UserDropdownActions []UserDropdownAction

	// SettingsBasePath is the base path for the settings page (e.g., "/dashboard/settings").
	// When non-empty, a collapsible "Settings" nav item is rendered in the sidebar.
	SettingsBasePath string

	// SettingsItems are the registered settings from all contributors.
	SettingsItems []contributor.ResolvedSetting
}

SidebarConfig holds all data needed to render the dashboard sidebar.

type UserDropdownAction added in v1.2.0

type UserDropdownAction struct {
	Label string // display text (e.g., "Profile")
	Icon  string // lucide icon name (e.g., "user")
	Href  string // navigation target (full path)
}

UserDropdownAction represents a configurable action in the sidebar footer user dropdown. Auth providers (e.g. authsome) contribute these via the DashboardFooterContributor interface.

Jump to

Keyboard shortcuts

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