Documentation
¶
Overview ¶
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
Index ¶
- func AuthRedirectScript() templ.Component
- func BreadcrumbsNav(crumbs []Breadcrumb, basePath string) templ.Component
- func ConnectionIndicator() templ.Component
- func DashboardStoreScript(basePath string) templ.Component
- func ForgeUIExtensionSidebar(cfg ExtensionSidebarConfig) templ.Component
- func ForgeUISidebar(cfg SidebarConfig) templ.Component
- func HTMXConfigScript() templ.Component
- func HTMXScript() templ.Component
- func HelperScripts() templ.Component
- func NotificationBell(basePath string) templ.Component
- func SSEClientScript(basePath string) templ.Component
- func SanitizeAlpineKey(name string) string
- func SearchKeyboardScript() templ.Component
- func SearchTrigger() templ.Component
- func ThemeToggle() templ.Component
- func TopBarComponent(title string, breadcrumbs []Breadcrumb, basePath string) templ.Component
- type Breadcrumb
- type ExtensionSidebarConfig
- type SidebarConfig
- type UserDropdownAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthRedirectScript ¶ added in v0.10.0
AuthRedirectScript handles HTMX 401 responses by reading the HX-Redirect header and performing a full-page redirect to the login page.
func BreadcrumbsNav ¶ added in v1.0.0
func BreadcrumbsNav(crumbs []Breadcrumb, basePath string) templ.Component
BreadcrumbsNav renders a breadcrumb navigation trail.
func ConnectionIndicator ¶ added in v1.0.0
ConnectionIndicator shows SSE connection status.
func DashboardStoreScript ¶
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 ¶
HTMXConfigScript configures HTMX behavior for the dashboard.
func HelperScripts ¶
HelperScripts provides utility JavaScript functions used throughout the dashboard.
func NotificationBell ¶ added in v1.0.0
NotificationBell renders the notification bell with unread count.
func SSEClientScript ¶ added in v1.2.0
SSEClientScript establishes the SSE connection and forwards events to Alpine.
func SanitizeAlpineKey ¶
SanitizeAlpineKey converts a group name to a valid Alpine.js variable name.
func SearchKeyboardScript ¶ added in v1.2.0
SearchKeyboardScript adds Cmd+K / Ctrl+K keyboard shortcut to open search.
func SearchTrigger ¶ added in v1.0.0
SearchTrigger renders the Cmd+K search button placeholder.
func ThemeToggle ¶ added in v1.0.0
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 ¶
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
// 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.