ui/checkbox_group

Types

Keyboard messages for checkbox group component.

pub type Msg {
  MoveNext
  MovePrev
  MoveFirst
  MoveLast
  Toggle
}

Constructors

  • MoveNext

    Move to next checkbox (ArrowRight or ArrowDown)

  • MovePrev

    Move to previous checkbox (ArrowLeft or ArrowUp)

  • MoveFirst

    Move to first checkbox (Home)

  • MoveLast

    Move to last checkbox (End)

  • Toggle

    Toggle the currently focused checkbox (Space)

pub type Size {
  Small
  Medium
  Large
}

Constructors

  • Small
  • Medium
  • Large
pub type Variant {
  Default
  Muted
}

Constructors

  • Default
  • Muted

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)
Search Document