abradley2 / form-fields / FormControls.TextInput

A text input widget for Elm

TEA

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


type Msg
    = NoOp
    | OnInput String
    | OnFocus
    | OnBlur
    | OnInputKeyPress Basics.Int

Msg


type alias Model =
{ id : String
, hasFocus : Basics.Bool 
}

Model Tracks the internal foxus state of the element


type alias Props =
{ id : String
, label : String
, value : String
, errorText : Maybe String
, helperText : Maybe String
, fieldType : FieldType 
}

Props