ui/number_field

Types

Messages for number field keyboard navigation

pub type Msg {
  Increment
  Decrement
  SetMin
  SetMax
  Clear
}

Constructors

  • Increment
  • Decrement
  • SetMin
  • SetMax
  • Clear
pub type Size {
  Small
  Medium
  Large
}

Constructors

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

Constructors

  • Default
  • Muted

Values

pub fn file() -> attribute.Attribute(a)
pub fn input(
  attributes: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn keymap(key_event: keyboard.KeyEvent) -> option.Option(Msg)

Keymap for number field keyboard navigation

Keyboard interactions:

  • ArrowUp: Increment value
  • ArrowDown: Decrement value
  • Home: Minimum value
  • End: Maximum value
  • Escape: Clear value

Follows WAI-ARIA Spinbutton pattern.

pub fn size(s: Size) -> attribute.Attribute(a)
Search Document