Checkbox

The b.Checkbox constructor creates a checkbox input, together with its label container.

ModifierAction
b.DisabledDisable the checkbox input
ChildAction
b.OnInput(...any)Apply children to the <input> element
b.OnLabel(...aby)Apply children to the <label> element
stringAdd to the <label> element
gomponents.Nodeof type gomponents.AttributeTypeApply attribute to the <input> element
gomponents.Nodeof type gomponents.ElementTypeAdd element to the <label> element
e.ElementAdd element to the <label> element
Anything elseApply child to the <input> element

Bulma examples

Example
Code
b.Checkbox("Remember me")
ResultHTML
Example
Code
b.Checkbox("I agree to the ", e.AHref("#", "terms and conditions"))
ResultHTML
Example
Code
b.Checkbox(b.Disabled, "Save my preferences")
ResultHTML

List of Checkboxes

Example
Code
b.Checkboxes(
	b.Checkbox("Monday"),
	b.Checkbox("Tuesday"),
	b.Checkbox("Wednesday"),
	b.Checkbox("Thursday"),
	b.Checkbox("Friday"),
	b.Checkbox("Saturday", b.Checked),
	b.Checkbox("Sunday", b.Checked),
)
ResultHTML