ui/color_slider

Types

Messages for color slider keyboard navigation

pub type Msg {
  Increase
  Decrease
  SetMin
  SetMax
  IncreaseLarge
  DecreaseLarge
}

Constructors

  • Increase
  • Decrease
  • SetMin
  • SetMax
  • IncreaseLarge
  • DecreaseLarge
pub type Variant {
  Default
  Muted
}

Constructors

  • Default
  • Muted

Values

pub fn aria_label(label: String) -> attribute.Attribute(a)
pub fn aria_valuenow(hue: Float) -> attribute.Attribute(a)
pub fn color_slider(
  attributes: List(attribute.Attribute(a)),
  children: List(element.Element(a)),
) -> element.Element(a)
pub fn hsl_to_hex(h: Float, s: Float, l: Float) -> String
pub fn keymap(key_event: keyboard.KeyEvent) -> option.Option(Msg)

Keymap for color slider keyboard navigation

Keyboard interactions:

  • Arrow Right/Up: Increase hue value
  • Arrow Left/Down: Decrease hue value
  • Home: Minimum value (0)
  • End: Maximum value (360)
  • PageUp: Large increment (+10)
  • PageDown: Large decrement (-10)

Follows WAI-ARIA Slider pattern.

pub fn max(hue: Float) -> attribute.Attribute(a)
pub fn min(hue: Float) -> attribute.Attribute(a)
pub fn slider_input(
  attributes: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn thumb(
  attributes: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn thumb_color(hue: Float) -> attribute.Attribute(a)
pub fn thumb_position(hue: Float) -> String
pub fn track(
  attributes: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn value(hue: Float) -> attribute.Attribute(a)
Search Document