achutkiran / material-components-elm / 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 : Basics.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, Platform.Cmd.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 : Basics.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, Platform.Cmd.Cmd msg )

Snackbar update functions

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

Snackbar view