appshell

package
v0.1.8 Latest Latest
Warning

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

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

Documentation

Overview

templ: version: v0.3.1020

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Header renders inside AppShell's persistent <header> landmark; supply
	// content, not another <header>; nil omits the wrapper.
	Header templ.Component
	// Sidebar renders desktop navigation; nil omits the sidebar wrapper.
	Sidebar templ.Component
	// Content renders inside the shell's single scrollable main region. When
	// nil, AppShell renders its templ children as the content slot.
	Content templ.Component
	// MainID identifies the main region and skip-link target; default is "main-content".
	MainID string
	// SkipLinkLabel is the visible keyboard-focus label; default is "Skip to main content".
	SkipLinkLabel string
	// RootClass appends CSS classes to the outer shell element.
	RootClass string
	// RootAttrs appends arbitrary HTML attributes to the outer shell element.
	RootAttrs templ.Attributes
	// HeaderClass appends CSS classes to the header wrapper.
	HeaderClass string
	// HeaderAttrs appends arbitrary HTML attributes to the header wrapper.
	HeaderAttrs templ.Attributes
	// SidebarClass appends CSS classes to the sidebar wrapper.
	SidebarClass string
	// SidebarAttrs appends arbitrary HTML attributes to the sidebar wrapper.
	SidebarAttrs templ.Attributes
	// MainClass appends CSS classes to the main region.
	MainClass string
	// MainAttrs appends arbitrary HTML attributes to the main region. AppShell
	// supplies tabindex="-1" by default so the skip-link target can receive
	// programmatic focus; set tabindex here to override that default.
	MainAttrs templ.Attributes
}

Config holds the application-shell regions and target-specific HTML hooks.

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

Instance is a renderable application-shell component.

func AppShell

func AppShell(cfg Config) Instance

AppShell returns a renderable application shell.

func (Instance) Kind

func (Instance) Kind() components.Kind

Kind identifies the component as an application shell.

func (Instance) Render

func (instance Instance) Render(ctx context.Context, writer io.Writer) error

Render writes the application-shell markup.

Jump to

Keyboard shortcuts

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