ui/switch

Types

Messages for switch keyboard navigation

pub type Msg {
  Toggle
}

Constructors

  • Toggle
pub type Size {
  Small
  Medium
  Large
}

Constructors

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

Constructors

  • Default
  • Muted

Values

pub fn keymap(key_event: keyboard.KeyEvent) -> option.Option(Msg)

Keymap for switch keyboard navigation

Keyboard interactions:

  • Space: Toggle state

Follows WAI-ARIA Switch pattern.

pub fn size(s: Size) -> attribute.Attribute(a)
pub fn switch(
  attributes: List(attribute.Attribute(a)),
  children: List(element.Element(a)),
) -> element.Element(a)
Search Document