FormField aligns a form field (for example, a checkbox) with its label and makes it RTL-aware. It also activates a ripple effect upon interacting with the label.
import Material.Checkbox
exposing
( checkbox
, checkboxConfig
)
import Material.FormField
exposing
( formField
, formFieldConfig
)
main =
formField { formFieldConfig | label = "My checkbox" }
[ checkbox checkboxConfig ]Default configuration of a form field
Configuration of a form field
If you want to position the label after the form field (ie. checkbox), set its alignEnd configuration field to True:
formField { label = "My checkbox", alignEnd = True } [ checkbox checkboxConfig ]
Form field view function