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: state.Interaction,
labels: ValueLabels,
max: Float,
min: Float,
size: config.Size,
step: Float,
)
}
Constructors
-
Config( discrete: Discrete, interaction: state.Interaction, labels: ValueLabels, max: Float, min: Float, size: config.Size, step: Float, )
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: config.Size
pub const default_step: Float
pub const default_value_labels: ValueLabels
pub fn disabled(s: Slider, i: state.Interaction) -> Slider
disabled sets the interaction field
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