Field

Defines a form field


The Field component sets the provided field name into the context so child components like input fields and labels can retrieve it and use it as the default field.


      
<Form for={%{}} as={:user}>
  <Field name={:email}>
    <Label>E-mail</Label>
    <div class="control">
      <TextInput value={@user["email"]}/>
    </div>
  </Field>
</Form>
    

# Public API

Name Description Type Values Default
name Required. The field name.

:any
class The CSS class for the generated <div> element.

:css_class