Helper text gives context about a field’s input, such as how the input will be used. It should be visible either persistently or only on focus.
import Material.HelperText exposing (helperText, helperTextConf)
import Material.TextField exposing (textField, textFieldConf)
main =
Html.div
[ textField { textFieldConf | label = "Your name" }
, helperText helperTextConf "Please fill this"
]The helper line is expected to be a direct sibling of the text field it belongs to and the helper text is expected to be a direct child of the helper text line.
Default configuration of a helper text
Configuration of a helper text
A text field's helper text may show unconditionally by setting its persistent
configuration field to True. By default a text field's helper text only shows
when the text field has focus.
To have a text field or text area display a character counter, set its
maxLength configuration field, and also add a characterCounter as a child
of helperLine.
[ textField
{ textFieldConfig
| maxLength = Just 18
}
, helperLine [] [ characterCounter [] ]
]Helper text line view function
The text line is expected to be the wrapping element of the helper text. It is expected to be a direct sibling of the text field that it belongs to.
Character counter view function
Helper text view function
The helper text is expected to be a direct child of the text line.