# 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

opaque </>

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

</>

Checked is whether the element is checked.

    pub type Checked {
      IsChecked
      IsNotChecked
    }

### Constructors

-     IsChecked

-     IsNotChecked

## Config

</>

Config is a public record for configuring this component.

    pub type Config {
      Config(checked: Checked, disabled: Disabled, value: String)
    }

### Constructors

-     Config(checked: Checked, disabled: Disabled, value: String)

## Disabled

</>

Disabled is whether the element is disabled.

    pub type Disabled {
      IsDisabled
      IsNotDisabled
    }

### Constructors

-     IsDisabled

-     IsNotDisabled

## Slot

</>

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

    pub type Slot {
      Icon
    }

### Constructors

-     Icon

# Values

## checked

</>

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

checked sets the value of checked for this ButtonSegment.

## default_checked

</>

    pub const default_checked: Checked

## default_config

</>

    pub fn default_config() -> Config

default_config is the default configuration for this component.

## default_disabled

</>

    pub const default_disabled: Disabled

## default_value

</>

    pub const default_value: String

## disabled

</>

    pub fn disabled(
      record: ButtonSegment,
      disabled: Disabled,
    ) -> ButtonSegment

disabled sets the value of disabled for this ButtonSegment.

## from_config

</>

    pub fn from_config(config: Config) -> ButtonSegment

from_config creates a new ButtonSegment from the given configuration.

## new

</>

    pub fn new() -> ButtonSegment

new creates a new ButtonSegment with the default configuration.

## render

</>

    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

## render_config

</>

    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

## slot

</>

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

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

## value

</>

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

value sets the value of value for this ButtonSegment.

✨