# m3e/button

Button is a button users interact with to perform an action.

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

         DO NOT EDIT

# Types

## Button

opaque </>

Button is a View Model for this component

## Fields:

- disabled: Whether the element is disabled.
- disabled_interactive: Whether the element is disabled and interactive.
- download: A value indicating whether the `target` of the link button will be downloaded, optionally specifying the new name of the file.
- href: The URL to which the link button points.
- name: The name of the element, submitted as a pair with the element’s `value` as part of form data, when the element is used to submit a form.
- rel: The relationship between the `target` of the link button and the document.
- selected: Whether the toggle button is selected.
- shape: The shape of the button.
- size: The size of the button.
- target: The target of the link button.
- toggle: Whether the button will toggle between selected and unselected states.
- type_: The type of the element.
- value: The value associated with the element’s name when it’s submitted with form data.
- variant: The appearance variant of the button.

    pub opaque type Button

## Config

</>

Config is a public record for configuring this component.

    pub type Config {
      Config(
        disabled: Disabled,
        disabled_interactive: DisabledInteractive,
        download: option.Option(String),
        href: String,
        name: String,
        rel: String,
        selected: Selected,
        shape: button_shape.ButtonShape,
        size: button_size.ButtonSize,
        target: option.Option(link_target.LinkTarget),
        toggle: Toggle,
        type_: form_submitter_type.FormSubmitterType,
        value: String,
        variant: button_variant.ButtonVariant,
      )
    }

### Constructors

-     Config(
        disabled: Disabled,
        disabled_interactive: DisabledInteractive,
        download: option.Option(String),
        href: String,
        name: String,
        rel: String,
        selected: Selected,
        shape: button_shape.ButtonShape,
        size: button_size.ButtonSize,
        target: option.Option(link_target.LinkTarget),
        toggle: Toggle,
        type_: form_submitter_type.FormSubmitterType,
        value: String,
        variant: button_variant.ButtonVariant,
      )

## Disabled

</>

Disabled is whether the element is disabled.

    pub type Disabled {
      IsDisabled
      IsNotDisabled
    }

### Constructors

-     IsDisabled

-     IsNotDisabled

## DisabledInteractive

</>

DisabledInteractive is whether the element is disabled and interactive.

    pub type DisabledInteractive {
      IsDisabledInteractive
      IsNotDisabledInteractive
    }

### Constructors

-     IsDisabledInteractive

-     IsNotDisabledInteractive

## Selected

</>

Selected is whether the toggle button is selected.

    pub type Selected {
      IsSelected
      IsNotSelected
    }

### Constructors

-     IsSelected

-     IsNotSelected

## Slot

</>

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

    pub type Slot {
      Icon
      Selected
      SelectedIcon
      TrailingIcon
    }

### Constructors

-     Icon

-     Selected

-     SelectedIcon

-     TrailingIcon

## Toggle

</>

Toggle is whether the button will toggle between selected and unselected states.

    pub type Toggle {
      IsToggle
      IsNotToggle
    }

### Constructors

-     IsToggle

-     IsNotToggle

# Values

## default_config

</>

    pub fn default_config() -> Config

default_config is the default configuration for this component.

## default_disabled

</>

    pub const default_disabled: Disabled

## default_disabled_interactive

</>

    pub const default_disabled_interactive: DisabledInteractive

## default_download

</>

    pub const default_download: option.Option(String)

## default_href

</>

    pub const default_href: String

## default_name

</>

    pub const default_name: String

## default_rel

</>

    pub const default_rel: String

## default_selected

</>

    pub const default_selected: Selected

## default_shape

</>

    pub const default_shape: button_shape.ButtonShape

## default_size

</>

    pub const default_size: button_size.ButtonSize

## default_target

</>

    pub const default_target: option.Option(link_target.LinkTarget)

## default_toggle

</>

    pub const default_toggle: Toggle

## default_type_

</>

    pub const default_type_: form_submitter_type.FormSubmitterType

## default_value

</>

    pub const default_value: String

## default_variant

</>

    pub const default_variant: button_variant.ButtonVariant

## disabled

</>

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

disabled sets the value of disabled for this Button.

## disabled_interactive

</>

    pub fn disabled_interactive(
      record: Button,
      disabled_interactive: DisabledInteractive,
    ) -> Button

disabled_interactive sets the value of disabled_interactive for this Button.

## download

</>

    pub fn download(
      record: Button,
      download: option.Option(String),
    ) -> Button

download sets the value of download for this Button.

## from_config

</>

    pub fn from_config(config: Config) -> Button

from_config creates a new Button from the given configuration.

## href

</>

    pub fn href(record: Button, href: String) -> Button

href sets the value of href for this Button.

## name

</>

    pub fn name(record: Button, name: String) -> Button

name sets the value of name for this Button.

## new

</>

    pub fn new() -> Button

new creates a new Button with the default configuration.

## rel

</>

    pub fn rel(record: Button, rel: String) -> Button

rel sets the value of rel for this Button.

## render

</>

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

render creates a Lustre Element for a Button

## 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 Button Config

## selected

</>

    pub fn selected(record: Button, selected: Selected) -> Button

selected sets the value of selected for this Button.

## shape

</>

    pub fn shape(
      record: Button,
      shape: button_shape.ButtonShape,
    ) -> Button

shape sets the value of shape for this Button.

## size

</>

    pub fn size(
      record: Button,
      size: button_size.ButtonSize,
    ) -> Button

size sets the value of size for this Button.

## slot

</>

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

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

## target

</>

    pub fn target(
      record: Button,
      target: option.Option(link_target.LinkTarget),
    ) -> Button

target sets the value of target for this Button.

## toggle

</>

    pub fn toggle(record: Button, toggle: Toggle) -> Button

toggle sets the value of toggle for this Button.

## type_

</>

    pub fn type_(
      record: Button,
      type_: form_submitter_type.FormSubmitterType,
    ) -> Button

type_ sets the value of type_ for this Button.

## value

</>

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

value sets the value of value for this Button.

## variant

</>

    pub fn variant(
      record: Button,
      variant: button_variant.ButtonVariant,
    ) -> Button

variant sets the value of variant for this Button.

✨