A text input widget for Elm
view : Model -> Props -> Html Msg
view The view function for displaying the text input element
init : String -> ( Model, Platform.Cmd.Cmd Msg )
init
Initialization for the text input model. The id
passed in must be unique
update : Msg -> Model -> ( Model, Platform.Cmd.Cmd Msg )
update The update function for the text input element
defaultProps : Props
defaultProps
Default props for the text input. Generally the label should be set before passing
these defaults to the view
Msg
OnInput
{ id : String
, hasFocus : Basics.Bool
}
Model Tracks the internal foxus state of the element
{ id : String
, label : String
, value : String
, errorText : Maybe String
, helperText : Maybe String
, fieldType : FieldType
}
Props
id
Unique id for the elementslabel
Label for the text inputvalue
The value of the text inputerrorText
Set this to a string when there is a validation error to display to the user. Will override helperText
helperText
Helpful text displayed under the text input