m3e/form_field

FormField is a container for form controls that applies Material Design styling and behavior.

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

     DO NOT EDIT

Types

Config is a public record for configuring this component.

pub type Config {
  Config(
    float_label: float_label_type.FloatLabelType,
    hide_required_marker: HideRequiredMarker,
    hide_subscript: hide_subscript_type.HideSubscriptType,
    variant: form_field_variant.FormFieldVariant,
  )
}

Constructors

FormField is a View Model for this component

Fields:

  • float_label: Specifies whether the label should float always or only when necessary.
  • hide_required_marker: Whether the required marker should be hidden.
  • hide_subscript: Whether subscript content is hidden.
  • variant: The appearance variant of the field.
pub opaque type FormField

HideRequiredMarker is whether the required marker should be hidden.

pub type HideRequiredMarker {
  IsHideRequiredMarker
  IsNotHideRequiredMarker
}

Constructors

  • IsHideRequiredMarker
  • IsNotHideRequiredMarker

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

pub type Slot {
  Prefix
  PrefixText
  Suffix
  SuffixText
  Hint
  Error
}

Constructors

  • Prefix
  • PrefixText
  • Suffix
  • SuffixText
  • Hint
  • Error

Values

pub fn default_config() -> Config

default_config is the default configuration for this component.

pub const default_hide_required_marker: HideRequiredMarker
pub fn float_label(
  record: FormField,
  float_label: float_label_type.FloatLabelType,
) -> FormField

float_label sets the value of float_label for this FormField.

pub fn from_config(config: Config) -> FormField

from_config creates a new FormField from the given configuration.

pub fn hide_required_marker(
  record: FormField,
  hide_required_marker: HideRequiredMarker,
) -> FormField

hide_required_marker sets the value of hide_required_marker for this FormField.

pub fn hide_subscript(
  record: FormField,
  hide_subscript: hide_subscript_type.HideSubscriptType,
) -> FormField

hide_subscript sets the value of hide_subscript for this FormField.

pub fn new() -> FormField

new creates a new FormField with the default configuration.

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

render creates a Lustre Element for a FormField

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

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

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

pub fn variant(
  record: FormField,
  variant: form_field_variant.FormFieldVariant,
) -> FormField

variant sets the value of variant for this FormField.

Search Document