m3e/button_segment
button_segment provides Lustre support for the M3E Button Segment component
Types
ButtonSegment provides Lustre support for the M3E Button Segment component
Fields:
- checked: Whether the element is checked
- disabled: Whether the element is disabled
- value: A string representing the value of the segment
pub opaque type ButtonSegment
Config allows for a declarative configuration of the ButtonSegment
pub type Config {
Config(
checked: state.SelectionState,
disabled: state.Interaction,
value: option.Option(String),
)
}
Constructors
-
Config( checked: state.SelectionState, disabled: state.Interaction, value: option.Option(String), )
Values
pub fn checked(
b: ButtonSegment,
checked: state.SelectionState,
) -> ButtonSegment
checked sets the checked field
pub fn disabled(
b: ButtonSegment,
disabled: state.Interaction,
) -> ButtonSegment
disabled sets the disabled field
pub fn from_config(c: Config) -> ButtonSegment
from_config creates a ButtonSegment from a Config
pub fn render(
b: ButtonSegment,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
render creates a Lustre Element(msg) from a ButtonSegment
Parameters:
- b: a ButtonSegment
- attributes: additional attributes
- children: additional children
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 Config
pub fn slot(s: Slot) -> attribute.Attribute(msg)
slot creates a Lustre ‘slot’ Attribute(msg) for a Slot
pub fn value(
b: ButtonSegment,
value: option.Option(String),
) -> ButtonSegment
value sets the value field