layout

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

Index

Constants

View Source
const MobileSheetPanelID = "ui8kit-mobile-sheet-panel"

MobileSheetPanelID is the dialog surface referenced by aria-controls on the menu trigger.

View Source
const MobileSheetTriggerID = "ui8kit-mobile-sheet-trigger"

MobileSheetTriggerID opens the mobile navigation dialog in the shell header.

Variables

This section is empty.

Functions

func Header(props HeaderProps) templ.Component

func Shell added in v0.2.0

func Shell(props ShellProps) templ.Component
func Sidebar(props SidebarProps) templ.Component

Types

type HeaderProps

type HeaderProps struct {
	Title                string
	Extra                templ.Component
	Trailing             templ.Component
	ThemeToggle          ThemeToggleProps
	ThemeToggleComponent templ.Component
}

HeaderProps configures the top header bar.

type NavItem struct {
	Path  string
	Label string
	Icon  string
}

NavItem describes a single sidebar navigation link.

type ShellProps

type ShellProps struct {
	Title                string           // HTML <title>
	Lang                 string           // HTML lang attribute (defaults to "en")
	BrandName            string           // sidebar brand label (defaults to "App")
	Active               string           // current path for nav highlight
	NavItems             []NavItem        // sidebar links
	CSSPath              string           // path to CSS file (defaults to "/static/css/app.css")
	ThemeJSPath          string           // path to theme JS bundle (defaults to "/static/js/theme.js")
	AppJSPath            string           // path to ui8kit app JS bundle (defaults to "/static/js/ui8kit.js")
	ThemeJSIntegrity     string           // optional integrity attribute for theme script
	AppJSIntegrity       string           // optional integrity attribute for app script
	JSPath               string           // deprecated alias for AppJSPath
	HeadExtra            templ.Component  // optional extra <head> content
	HeaderExtra          templ.Component  // optional extra header actions before theme toggle
	HeaderTrailing       templ.Component  // optional trailing header actions after theme toggle
	ThemeToggle          ThemeToggleProps // optional copy for the theme toggle button
	ThemeToggleComponent templ.Component  // optional custom theme toggle component
	// MarketingShell enables full-width marketing layout: no desktop sidebar, header grid, mobile header-nav hidden (nav stays in the sheet).
	MarketingShell bool
}

ShellProps configures the full page shell (sidebar + header + main).

type SidebarProps

type SidebarProps struct {
	Items  []NavItem
	Active string
	Mobile bool
}

SidebarProps configures the sidebar navigation.

type ThemeToggleProps added in v0.2.0

type ThemeToggleProps struct {
	Label              string
	SwitchToDarkLabel  string
	SwitchToLightLabel string
}

ThemeToggleProps configures copy for the theme toggle button.

Jump to

Keyboard shortcuts

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