m3e/switch
Switch is an on/off control that can be toggled by clicking.
This file was generated: By: m3e/generator version 0.1.0 At: 2026-05-05T14:38:23+10:00
DO NOT EDIT
Types
Checked is whether the element is checked.
pub type Checked {
IsChecked
IsNotChecked
}
Constructors
-
IsChecked -
IsNotChecked
Config is a public record for configuring this component.
pub type Config {
Config(
checked: Checked,
disabled: Disabled,
icons: switch_icons.SwitchIcons,
name: String,
value: String,
)
}
Constructors
-
Config( checked: Checked, disabled: Disabled, icons: switch_icons.SwitchIcons, name: String, value: String, )
Disabled is whether the element is disabled.
pub type Disabled {
IsDisabled
IsNotDisabled
}
Constructors
-
IsDisabled -
IsNotDisabled
Switch is a View Model for this component
Fields:
- checked: Whether the element is checked.
- disabled: Whether the element is disabled.
- icons: The icons to present.
- name: The name that identifies the element when submitting the associated form.
- value: A string representing the value of the switch.
pub opaque type Switch
Values
pub fn checked(record: Switch, checked: Checked) -> Switch
checked sets the value of checked for this Switch.
pub const default_checked: Checked
pub fn default_config() -> Config
default_config is the default configuration for this component.
pub const default_disabled: Disabled
pub const default_icons: switch_icons.SwitchIcons
pub const default_name: String
pub const default_value: String
pub fn disabled(record: Switch, disabled: Disabled) -> Switch
disabled sets the value of disabled for this Switch.
pub fn from_config(config: Config) -> Switch
from_config creates a new Switch from the given configuration.
pub fn icons(
record: Switch,
icons: switch_icons.SwitchIcons,
) -> Switch
icons sets the value of icons for this Switch.
pub fn render(
model: Switch,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
render creates a Lustre Element for a Switch
pub fn render_config(
c: Config,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
render_config creates a Lustre Element from a Switch Config