templx

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: 5 Imported by: 0

Documentation

Overview

Package templx bridges templ: children for templ components, and the components of .templ files a vuka.File names. ui.Node is templ.Component, so components need no adapter either way; children do, because templ passes them on the context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(key string, components ...Component)

Register records the components compiled from a .templ file. Code the vuka command generates for a vuka.File naming one calls it.

func WithChildren

func WithChildren(c ui.Node, children ui.Node) ui.Node

WithChildren renders c with children as its templ children: ui.WithChildren.

Types

type Component

type Component struct {
	Name   string
	Func   any
	Params []string
}

Component is a component of a .templ file: its name, the generated function (func(params…) templ.Component) and its parameters' names.

func Components

func Components(f vuka.File) ([]Component, bool)

Components are the components of an embedded .templ file, in source order: all of them for a file of the referencing package, the exported ones for a file of a subdirectory's package.

type Rec added in v0.5.0

type Rec = ui.Rec

Rec records a templ component's render into a live render tree: ui.Rec. The vuka command compiles the .templ files of a module requiring ui to call it, so on a live page their markup diffs as JSX does.

func Record added in v0.5.0

func Record(ctx context.Context, w io.Writer) Rec

Record is ui.Record. Generated code calls it.

Jump to

Keyboard shortcuts

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