ui/checkbox_group
Types
Keyboard messages for checkbox group component.
pub type Msg {
MoveNext
MovePrev
MoveFirst
MoveLast
Toggle
}
Constructors
-
MoveNextMove to next checkbox (ArrowRight or ArrowDown)
-
MovePrevMove to previous checkbox (ArrowLeft or ArrowUp)
-
MoveFirstMove to first checkbox (Home)
-
MoveLastMove to last checkbox (End)
-
ToggleToggle the currently focused checkbox (Space)
Values
pub fn checkbox_element_id(index: Int) -> String
Get the element ID for a checkbox at the given index.
pub fn checkbox_group(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn description(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn keymap(key_event: keyboard.KeyEvent) -> option.Option(Msg)
Keymap for checkbox group keyboard navigation. Follows WAI-ARIA checkbox group pattern:
- ArrowRight/ArrowDown: Move to next checkbox
- ArrowLeft/ArrowUp: Move to previous checkbox
- Home: Move to first checkbox
- End: Move to last checkbox
- Space: Toggle the currently focused checkbox
pub fn label(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn size(s: Size) -> attribute.Attribute(a)
pub fn variant(v: Variant) -> attribute.Attribute(a)