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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func A

func A(props Props, children ...ui.Node) ui.Node

func Article

func Article(props Props, children ...ui.Node) ui.Node

func Aside

func Aside(props Props, children ...ui.Node) ui.Node

func Blockquote

func Blockquote(props Props, children ...ui.Node) ui.Node

func Br

func Br(props Props) ui.Node

func Button

func Button(props Props, children ...ui.Node) ui.Node

func Code

func Code(props Props, children ...ui.Node) ui.Node

func Dialog

func Dialog(props Props, children ...ui.Node) ui.Node

func Div

func Div(props Props, children ...ui.Node) ui.Node

func Em

func Em(props Props, children ...ui.Node) ui.Node

func Fieldset

func Fieldset(props Props, children ...ui.Node) ui.Node
func Footer(props Props, children ...ui.Node) ui.Node

func Form

func Form(props Props, children ...ui.Node) ui.Node

func Fragment

func Fragment(children ...ui.Node) ui.Node

func H1

func H1(props Props, children ...ui.Node) ui.Node

func H2

func H2(props Props, children ...ui.Node) ui.Node

func H3

func H3(props Props, children ...ui.Node) ui.Node

func H4

func H4(props Props, children ...ui.Node) ui.Node

func H5

func H5(props Props, children ...ui.Node) ui.Node

func H6

func H6(props Props, children ...ui.Node) ui.Node
func Header(props Props, children ...ui.Node) ui.Node

func Hr

func Hr(props Props) ui.Node

func Img

func Img(props Props) ui.Node

func Input

func Input(props Props) ui.Node

func Label

func Label(props Props, children ...ui.Node) ui.Node

func Legend

func Legend(props Props, children ...ui.Node) ui.Node

func Li

func Li(props Props, children ...ui.Node) ui.Node

func Main

func Main(props Props, children ...ui.Node) ui.Node
func Nav(props Props, children ...ui.Node) ui.Node

func Option

func Option(props Props, children ...ui.Node) ui.Node

func P

func P(props Props, children ...ui.Node) ui.Node

func Pre

func Pre(props Props, children ...ui.Node) ui.Node

func Section

func Section(props Props, children ...ui.Node) ui.Node

func Select

func Select(props Props, children ...ui.Node) ui.Node

func Small

func Small(props Props, children ...ui.Node) ui.Node

func Span

func Span(props Props, children ...ui.Node) ui.Node

func Strong

func Strong(props Props, children ...ui.Node) ui.Node

func Tag

func Tag(name string, props Props, children ...ui.Node) ui.Node

func Text

func Text(content string) ui.Node

func Textarea

func Textarea(props Props, children ...ui.Node) ui.Node

func Time

func Time(props Props, children ...ui.Node) ui.Node

func Ul

func Ul(props Props, children ...ui.Node) ui.Node

Types

type Props

type Props struct {
	ID           string
	Class        string
	Key          string
	Title        string
	Type         string
	Name         string
	Value        string
	Placeholder  string
	Href         string
	Src          string
	Alt          string
	For          string
	Role         string
	Target       string
	Rel          string
	Action       string
	Method       string
	AutoComplete string
	Min          string
	Max          string
	Step         string

	Rows int
	Cols int

	Checked   bool
	Disabled  bool
	Selected  bool
	Required  bool
	ReadOnly  bool
	Hidden    bool
	Multiple  bool
	AutoFocus bool

	Style map[string]string
	Data  map[string]string
	Aria  map[string]string
	Raw   map[string]interface{}

	OnClick   ui.Handler
	OnInput   ui.Handler
	OnChange  ui.Handler
	OnSubmit  ui.Handler
	OnKeyDown ui.Handler
	OnKeyUp   ui.Handler
	OnFocus   ui.Handler
	OnBlur    ui.Handler
}

Jump to

Keyboard shortcuts

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