glaze/basecoat/checkbox
Basecoat documentation: https://basecoatui.com/components/checkbox/
Checkbox helpers for boolean selections.
Use checkbox for the input itself, or the convenience helpers
for common label/description layouts.
Recipe
import glaze/basecoat/checkbox
import lustre/attribute
import lustre/element/html
fn terms_checkbox() {
checkbox.with_label("terms", "Accept terms", [
attribute.checked(True),
])
}
Values
pub fn checkbox(
attrs: List(attribute.Attribute(msg)),
) -> element.Element(msg)
pub fn checked() -> attribute.Attribute(msg)
pub fn disabled() -> attribute.Attribute(msg)
pub fn id(id: String) -> attribute.Attribute(msg)
pub fn name(n: String) -> attribute.Attribute(msg)
pub fn value(v: String) -> attribute.Attribute(msg)
pub fn with_description(
id: String,
label_text: String,
description: String,
attrs: List(attribute.Attribute(msg)),
) -> element.Element(msg)
pub fn with_label(
id: String,
label_text: String,
attrs: List(attribute.Attribute(msg)),
) -> element.Element(msg)