achutkiran/material-components-elm/1.0.0

NOTE: the latest version is 1.2.1

Mwc.Snackbar

Material Snackbar. It was designed following material design principles

type alias Model msg a =
{ queue : List (Config msg a)
, state : State msg a
, index : Int
}

SnackBar model

type Msg msg a

SnackBar Messages

actionClick : (Maybe a -> msg) -> Property msg a

Sets click functionality to action button

add :
List (Property msg a)
-> Model msg a
-> (Msg msg a -> msg)
-> ( Model msg a, Cmd msg )

used to add snackbar or toast

buttonText : String -> Property msg a

Sets Action button text

message : String -> Property msg a

Sets message to be displayed

model : Model msg a

default model for snackbar

payload : a -> Property msg a

payload which is returned when action button is clicked

timeout : Float -> Property msg a

Amount of time (in ms) the snackbar should be displayed default is 3000ms

update : Msg msg a -> Model msg a -> ( Model msg a, Cmd msg )

Snackbar update functions

view : Model msg a -> (Msg msg a -> msg) -> Html msg

Snackbar view