templdemo

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

Package templdemo is templ components, compiled by the vuka command to record live render trees, and pages using them, for the live package's tests. The *_templ.go and *_vuka.go files are generated: vuka gen -inplace ./live/internal/templdemo

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BooksPage

func BooksPage(books []string) ui.Node

func InboxPage

func InboxPage() ui.Node

InboxPage and BooksPage are pages sharing the templ Layout.

func Layout

func Layout(title string, current string) templ.Component

Layout is the pages' document: a head, a nav marking the current page and a footer, around the page's content.

func Opaque

func Opaque(n ui.Node) ui.Node

Opaque renders n as one piece of markup, as templ's own code does: the baseline the tests measure recorded trees against.

func Panel

func Panel(heading string, badge int) templ.Component

Panel is a box with a heading and a badge around its content.

func Shelf

func Shelf(books []string) templ.Component

Shelf lists books, each in a Panel.

Types

type Inbox

type Inbox struct {
	ui.Live
	Unread int
	Opaque bool // the Panel as one piece of markup (Opaque)
	// contains filtered or unexported fields
}

Inbox is a stateful component rendering a templ Panel: reading a message changes the Panel's badge alone.

func (*Inbox) Read

func (b *Inbox) Read()

func (*Inbox) Render

func (b *Inbox) Render() ui.Node

Jump to

Keyboard shortcuts

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