alexanderkiel/elm-mdc-alpha/1.4.0

Material.TextField

Text fields let users enter and edit text.

Install

In your application install:

npm install "@material/textfield"

In your Sass file import:

@import "@material/textfield/mdc-text-field";

Model

type alias Model context problem value =
{ focused : Bool
, parser : Parser context problem value
, value : Maybe value
, parseError : List (DeadEnd context problem)
, input : Maybe String
}

The full model requires the type params context and problem as defined in Parser.Advanced. Use SimpleModel if you plan to use a normal parser.

type alias SimpleModel value =
Model Never Problem value

The simple model should be used if a normal parser is sufficient.

Parser context problem value
-> (value -> String)
-> Maybe value
-> Model context problem value

Update

type Msg
update : Msg -> Model context problem value -> Model context problem value

View

RequiredConfig msg value
-> Model context problem value
-> List (Property msg value)
-> List (Html msg)
-> Html msg

Properties

fullWidth : Property msg value
outlined : Property msg value
label : String -> Property msg value
leadingIcon : String -> Property msg value
trailingIcon : String -> Property msg value

Reference