Skip to main content

Module html

Module html 

Source
Expand description

el builders, one per allowed tag.

Plain HTML elements a program styles with its own sheet, and checkbox and radio controls whose flips come back as change events; a form’s values ride on every event from inside it.

§Example

use tern_sdk::ui::{Actions, Node, html};

let form: Node = html::form()
	.class("ask")
	.child(html::p("Which size?"))
	.child(
		html::label()
			.child(html::radio("size", "s"))
			.child(html::span("Small")),
	)
	.child(html::button("Create").actions(Actions::new().click("submit")))
	.into();
assert_eq!(form.child_nodes().len(), 3);

Structs§

El
el: one HTML element of an allowed tag, its text, then its children.

Functions§

article
article.
aside
aside.
b
b.
blockquote
blockquote.
button
button: give it actions (or on_click) to make it do something.
checkbox
A checkbox named name reporting value (a lone box reports true/false in its form’s values).
code
code: inline code.
dd
dd: a definition.
del
del: deleted text.
div
div: a block.
dl
dl: a description list.
dt
dt: a term.
el
An el of any tag.
em
em.
figure
figure.
footer
footer.
form
form: groups controls; events from inside carry its values.
h1
h1.
h2
h2.
h3
h3.
h4
h4.
header
header.
hr
hr: a rule (no children).
i
i.
input
input: a control of kind.
kbd
kbd: a key.
label
label: names the controls inside it; a click flips the first.
li
li: a list item.
main
main.
mark
mark: highlighted text.
nav
nav.
ol
ol: a numbered list.
p
p: a paragraph.
pre
pre: preformatted text.
radio
A radio of group name reporting value.
section
section.
span
span: inline text.
strong
strong.
table
table.
tbody
tbody.
td
td: a cell.
th
th: a header cell.
thead
thead.
tr
tr: a table row.
ul
ul: a bulleted list.