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 as Checkbox
import Material.FormField as FormField
main =
FormField.formField
(FormField.config
|> FormField.setLabel (Just "My checkbox")
)
[ Checkbox.checkbox Checkbox.config ]Specify a message when the user clicks on the label
Specify whether the form field's label is positioned after its control
This is usefile for, say, checkboxes.
Specify additional attributes
If you want to position the label after the form field's control, set its
setAlignEnd configuration option to True.
FormField.formField
(FormField.config |> FormField.setAlignEnd True)
[ Checkbox.checkbox Checkbox.config ]
Configuration of a form field