m3e/button_segment

ButtonSegment is a option that can be selected within a segmented button.

This file was generated: By: m3e/generator version 0.1.0 At: 2026-05-05T14:38:23+10:00

     DO NOT EDIT

Types

ButtonSegment is a View Model for this 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

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, value: String)
}

Constructors

Disabled is whether the element is disabled.

pub type Disabled {
  IsDisabled
  IsNotDisabled
}

Constructors

  • IsDisabled
  • IsNotDisabled

Slots are used in child elements to insert content into this component

pub type Slot {
  Icon
}

Constructors

  • Icon

Values

pub fn checked(
  record: ButtonSegment,
  checked: Checked,
) -> ButtonSegment

checked sets the value of checked for this ButtonSegment.

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_value: String
pub fn disabled(
  record: ButtonSegment,
  disabled: Disabled,
) -> ButtonSegment

disabled sets the value of disabled for this ButtonSegment.

pub fn from_config(config: Config) -> ButtonSegment

from_config creates a new ButtonSegment from the given configuration.

pub fn new() -> ButtonSegment

new creates a new ButtonSegment with the default configuration.

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

render creates a Lustre Element for a ButtonSegment

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 ButtonSegment Config

pub fn slot(s: Slot) -> attribute.Attribute(msg)

slot returns a Lustre Attribute(msg) for the given slot name

pub fn value(
  record: ButtonSegment,
  value: String,
) -> ButtonSegment

value sets the value of value for this ButtonSegment.

Search Document