abradley2/form-elements/4.1.0

NOTE: the latest version is 4.1.2

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 Int

Msg

  • OnInput
type alias Model =
{ id : String
, hasFocus : 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 Never

Type alias for the Component Result of this elements

= ValueChanged String

ExternalMsg

  • ValueChanged String