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 ¶
- func A(props Props, children ...ui.Node) ui.Node
- func Article(props Props, children ...ui.Node) ui.Node
- func Aside(props Props, children ...ui.Node) ui.Node
- func Blockquote(props Props, children ...ui.Node) ui.Node
- func Br(props Props) ui.Node
- func Button(props Props, children ...ui.Node) ui.Node
- func Code(props Props, children ...ui.Node) ui.Node
- func Dialog(props Props, children ...ui.Node) ui.Node
- func Div(props Props, children ...ui.Node) ui.Node
- func Em(props Props, children ...ui.Node) ui.Node
- func Fieldset(props Props, children ...ui.Node) ui.Node
- func Footer(props Props, children ...ui.Node) ui.Node
- func Form(props Props, children ...ui.Node) ui.Node
- func Fragment(children ...ui.Node) ui.Node
- func H1(props Props, children ...ui.Node) ui.Node
- func H2(props Props, children ...ui.Node) ui.Node
- func H3(props Props, children ...ui.Node) ui.Node
- func H4(props Props, children ...ui.Node) ui.Node
- func H5(props Props, children ...ui.Node) ui.Node
- func H6(props Props, children ...ui.Node) ui.Node
- func Header(props Props, children ...ui.Node) ui.Node
- func Hr(props Props) ui.Node
- func Img(props Props) ui.Node
- func Input(props Props) ui.Node
- func Label(props Props, children ...ui.Node) ui.Node
- func Legend(props Props, children ...ui.Node) ui.Node
- func Li(props Props, children ...ui.Node) ui.Node
- func Main(props Props, children ...ui.Node) ui.Node
- func Nav(props Props, children ...ui.Node) ui.Node
- func Option(props Props, children ...ui.Node) ui.Node
- func P(props Props, children ...ui.Node) ui.Node
- func Pre(props Props, children ...ui.Node) ui.Node
- func Section(props Props, children ...ui.Node) ui.Node
- func Select(props Props, children ...ui.Node) ui.Node
- func Small(props Props, children ...ui.Node) ui.Node
- func Span(props Props, children ...ui.Node) ui.Node
- func Strong(props Props, children ...ui.Node) ui.Node
- func Tag(name string, props Props, children ...ui.Node) ui.Node
- func Text(content string) ui.Node
- func Textarea(props Props, children ...ui.Node) ui.Node
- func Time(props Props, children ...ui.Node) ui.Node
- func Ul(props Props, children ...ui.Node) ui.Node
- type Props
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
}
Click to show internal directories.
Click to hide internal directories.