abadi199 / elm-input-extra / Input.Text

Text input

View

input : Options msg -> List (Html.Attribute msg) -> String -> Html msg

Text input element

Example:

type Msg = InputUpdated String | FocusUpdated Bool

Input.Text.input
    { maxLength = 10
    , onInput = InputUpdated
    , hasFocus = Just FocusUpdated
    }
    [ class "textInput"
    ...
    ]
    model.currentValue


type alias Options msg =
{ maxLength : Maybe Basics.Int
, onInput : String -> msg
, hasFocus : Maybe (Basics.Bool -> msg)
, type_ : String 
}

Options of the input component.

defaultOptions : (String -> msg) -> Options msg

Default value for Options.

Value:

{ maxLength = Nothing
, onInput = onInput
, hasFocus = Nothing
, type_ = "text"
}