layout

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package layout provides composable layout builders for ForgeUI applications.

The layout package is designed for building root layouts that define the complete HTML structure with head and body sections. Child layouts should use standard gomponents to wrap content with structural elements only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alpine

func Alpine() g.Node

Alpine injects Alpine.js cloak CSS into the head This prevents flash of unstyled content before Alpine initializes

func AlpineBridgeClient

func AlpineBridgeClient() g.Node

AlpineBridgeClient injects the Alpine.js bridge client script

func AlpineScripts

func AlpineScripts(plugins ...alpine.Plugin) g.Node

AlpineScripts injects Alpine.js scripts at the end of body Accepts optional plugins

func Body

func Body(content ...g.Node) g.Node

Body creates a body section with the given content

func BridgeClient

func BridgeClient() g.Node

BridgeClient injects the ForgeUI bridge client script

func Build

func Build(head g.Node, body g.Node) g.Node

Build creates a new layout builder and returns the complete HTML document

func BuildWithLang

func BuildWithLang(lang string, head g.Node, body g.Node) g.Node

BuildWithLang creates a new layout builder with custom language

func Charset

func Charset(charset string) g.Node

Charset creates a charset meta tag

func Class

func Class(classes string) g.Node

Class adds CSS classes to an element

func DarkModeScript

func DarkModeScript() g.Node

DarkModeScript injects the dark mode toggle script into the body

func Description

func Description(description string) g.Node

Description creates a meta description tag

func Favicon

func Favicon(href string) g.Node

Favicon adds a favicon link to the head

func GoogleFonts

func GoogleFonts(families ...string) g.Node

GoogleFonts adds Google Fonts preconnect and stylesheet links

func Head(content ...g.Node) g.Node

Head creates a head section with the given content

func HotReload

func HotReload() g.Node

HotReload injects the hot reload script for development mode This should only be used in development

func InlineScript

func InlineScript(content string) g.Node

InlineScript creates an inline script element

func InlineStyle

func InlineStyle(content string) g.Node

InlineStyle creates an inline style element

func Link(rel, href string, attrs ...g.Node) g.Node

Link creates a link element

func Meta

func Meta(name, content string) g.Node

Meta creates a meta tag

func OpenGraph

func OpenGraph(title, description, image, url string) g.Node

OpenGraph adds Open Graph meta tags for social media sharing

func Preload

func Preload(href, as string) g.Node

Preload adds a preload link for critical resources

func PreloadFont

func PreloadFont(href string) g.Node

PreloadFont adds a preload link for fonts

func ProviderScriptUtilities

func ProviderScriptUtilities() g.Node

ProviderScriptUtilities injects the provider utility scripts

func Script

func Script(src string, attrs ...g.Node) g.Node

Script creates a script element

func Scripts

func Scripts(scripts ...g.Node) g.Node

Scripts creates a script section (typically at end of body)

func StyleSheet

func StyleSheet(href string) g.Node

StyleSheet creates a stylesheet link

func Styles

func Styles(styles ...g.Node) g.Node

Styles creates a style section in the head

func Theme

func Theme(lightTheme, darkTheme *theme.Theme) g.Node

Theme injects theme system (styles and scripts) into the layout Supports both light and dark themes

func ThemeSingle

func ThemeSingle(t *theme.Theme) g.Node

ThemeSingle injects a single theme into the layout (uses same theme for light and dark)

func Title

func Title(title string) g.Node

Title creates a title element

func TwitterCard

func TwitterCard(title, description, image string) g.Node

TwitterCard adds Twitter Card meta tags

func Viewport

func Viewport(content string) g.Node

Viewport creates a viewport meta tag

Types

type Builder

type Builder struct {
}

Builder represents a layout builder for creating complete HTML documents

Jump to

Keyboard shortcuts

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