abradley2 / form-elements / FormElements.TextInput

A text input widget for Elm

TEA

view : Model -> Props -> Html Msg

The view for displaying the element.

init : String -> Model

Initialization for the text input model. The id passed in must be unique

update : Msg -> Model -> TextInputResult

The main update function for the text input element

defaultProps : Props

Useful default props to extend off when supplying props to the element.


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 
}

Configurable properties for rendering the view


type alias TextInputResult =
ComponentResult Model Msg ExternalMsg Basics.Never

Type alias for the Component Result of this elements


type ExternalMsg
    = ValueChanged String

ExternalMsg