# 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

</>

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

-     Config(
        float_label: float_label_type.FloatLabelType,
        hide_required_marker: HideRequiredMarker,
        hide_subscript: hide_subscript_type.HideSubscriptType,
        variant: form_field_variant.FormFieldVariant,
      )

## FormField

opaque </>

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

</>

HideRequiredMarker is whether the required marker should be hidden.

    pub type HideRequiredMarker {
      IsHideRequiredMarker
      IsNotHideRequiredMarker
    }

### Constructors

-     IsHideRequiredMarker

-     IsNotHideRequiredMarker

## Slot

</>

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

## default_config

</>

    pub fn default_config() -> Config

default_config is the default configuration for this component.

## default_float_label

</>

    pub const default_float_label: float_label_type.FloatLabelType

## default_hide_required_marker

</>

    pub const default_hide_required_marker: HideRequiredMarker

## default_hide_subscript

</>

    pub const default_hide_subscript: hide_subscript_type.HideSubscriptType

## default_variant

</>

    pub const default_variant: form_field_variant.FormFieldVariant

## float_label

</>

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

float_label sets the value of float_label for this FormField.

## from_config

</>

    pub fn from_config(config: Config) -> FormField

from_config creates a new FormField from the given configuration.

## hide_required_marker

</>

    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.

## hide_subscript

</>

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

hide_subscript sets the value of hide_subscript for this FormField.

## new

</>

    pub fn new() -> FormField

new creates a new FormField with the default configuration.

## render

</>

    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

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

## slot

</>

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

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

## variant

</>

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

variant sets the value of variant for this FormField.

✨