ui/slider

Types

Keyboard messages for slider component.

pub type Msg {
  Decrease
  Increase
  SetMin
  SetMax
  PageIncrease
  PageDecrease
}

Constructors

  • Decrease

    Decrease value (ArrowLeft or ArrowDown)

  • Increase

    Increase value (ArrowRight or ArrowUp)

  • SetMin

    Set to minimum value (Home)

  • SetMax

    Set to maximum value (End)

  • PageIncrease

    Increase value by larger step (PageUp)

  • PageDecrease

    Decrease value by larger step (PageDown)

Slider orientation.

pub type Orientation {
  Horizontal
  Vertical
}

Constructors

  • Horizontal
  • Vertical
pub type Size {
  Small
  Medium
  Large
}

Constructors

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

Constructors

  • Default
  • Muted

Values

pub fn aria_label(label: String) -> attribute.Attribute(a)
pub fn aria_valuemax(value: Int) -> attribute.Attribute(a)
pub fn aria_valuemin(value: Int) -> attribute.Attribute(a)
pub fn aria_valuenow(value: Int) -> attribute.Attribute(a)
pub fn keymap(
  key_event: keyboard.KeyEvent,
  orientation: Orientation,
) -> option.Option(Msg)

Keymap for slider keyboard navigation. Follows WAI-ARIA slider pattern:

  • ArrowLeft/ArrowDown: Decrease value
  • ArrowRight/ArrowUp: Increase value
  • Home: Set to minimum value
  • End: Set to maximum value
  • PageUp: Increase by larger step (optional)
  • PageDown: Decrease by larger step (optional)
pub fn max(value: Int) -> attribute.Attribute(a)
pub fn min(value: Int) -> attribute.Attribute(a)
pub fn orientation(o: Orientation) -> attribute.Attribute(a)

Set slider orientation.

pub fn size(s: Size) -> attribute.Attribute(a)
pub fn slider(
  attributes: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn thumb_size(s: Size) -> attribute.Attribute(a)
pub fn value(value: Int) -> attribute.Attribute(a)
Search Document