m3e/slider

slider provides Lustre support for the M3E Slider component

Types

Config holds the configuration for a Slider

pub type Config {
  Config(
    discrete: Discrete,
    interaction: types.Interaction,
    labels: ValueLabels,
    max: Float,
    min: Float,
    size: size_many.Size,
    step: Float,
  )
}

Constructors

Discrete specifies if a slider is discrete or continuous

pub type Discrete {
  Discrete
  Continuous
}

Constructors

  • Discrete
  • Continuous

Slider provides Lustre support for the M3E Slider component

Fields:

  • discrete: Whether to show tick marks
  • interaction: Whether the element is enabled or disabled
  • labels: Whether to show value labels when activated
  • max: The maximum allowable value
  • min: The minimum allowable value
  • size: The size of the slider
  • step: The value at which the thumb will snap
pub opaque type Slider

ValueLabels specifies if a slider shows value labels

pub type ValueLabels {
  ShowLabels
  HideLabels
}

Constructors

  • ShowLabels
  • HideLabels

Values

pub fn default_config() -> Config

default_config creates a new Config with default values

pub const default_discrete: Discrete
pub const default_max: Float
pub const default_min: Float
pub const default_size: size_many.Size
pub const default_step: Float
pub const default_value_labels: ValueLabels
pub fn disabled(s: Slider, i: types.Interaction) -> Slider

disabled sets the interaction field

pub fn discrete(s: Slider, d: Discrete) -> Slider

discrete sets the discrete field

pub fn from_config(c: Config) -> Slider

from_config creates a Slider from a Config record

pub fn labelled(s: Slider, l: ValueLabels) -> Slider

labelled sets the labels field

pub fn max(s: Slider, max: Float) -> Slider

max sets the max field

pub fn min(s: Slider, min: Float) -> Slider

min sets the min field

pub fn new() -> Slider

new creates a new Slider

pub fn render(
  s: Slider,
  attributes: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)

render creates a Lustre Element(msg) from a Slider

Parameters:

  • s: a Slider
  • attributes: additional attributes
  • children: additional children
pub fn render_config(
  config: Config,
  attributes: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)

render_config creates a Lustre Element directly from a Config

pub fn size(s: Slider, size: size_many.Size) -> Slider

size sets the size field

pub fn step(s: Slider, step: Float) -> Slider

step sets the step field

Search Document