html

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package html provides typed HTML element builders for GoWebComponents.

The package is designed to pair with the ui package:

func Counter() ui.Node {
    count := ui.UseState(0)
    increment := ui.UseEvent(func() {
        count.Update(func(v int) int { return v + 1 })
    })

    return html.Div(html.Props{},
        html.H1(html.Props{}, html.Text("Counter")),
        html.Button(html.Props{OnClick: increment}, html.Text("Increment")),
    )
}

html.Props keeps common DOM metadata explicit while still exposing Raw for escape-hatch attributes that do not need first-class fields yet.

Jump to

Keyboard shortcuts

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