alexanderkiel/elm-mdc-alpha/1.3.0

NOTE: the latest version is 1.4.0

Material.Select

MDC Select provides Material Design single-option select menus.

Install

In your application install:

npm install "@material/select"

In your Sass file import:

@import "@material/select/mdc-select";

Model

type alias Model =
{ focused : Bool
, value : Maybe String
}

For each select, place a model value in your model.

init : Maybe String -> Model

Initializes the select menu with the following value.

Update

type Msg

Internal message type. Create a message which transports messages of that type.

update : Msg -> Model -> Model

Internal update function. Has to be called by your module on messages from every select menu you use.

View

(Msg -> msg)
-> Model
-> List (Property msg)
-> List (Html msg)
-> Html msg

Renders a select menu.

Takes a message lifter and the model.

Properties

label : String -> Property msg

Sets the label text. The selects label will be empty without setting this.

Reference