|license||Mozilla Public License 2.0|
|elm-version||0.16.0 <= v < 0.17.0|
|Committed At||2016-04-28 12:49:12 UTC|
Easily display toast notifications to users. The module defines four common alert levels (success, info, warning and error) and takes care of managing toast lifecycles.
See the demo to get a nice overview of the capabilities.
elm package install KtorZ/elm-notification
Within your app, first connect the effects runner to a port (or alternatively, merged it into one of your effects signal that is already bound to a port).
port notifications : Signal (Task Effects.Never ()) port notifications = Notification.task
Then, fold on the view signal and display a view accordingly:
view : Html -> Html view notifications = div  [notifications] main = Signal.map view Notification.view
To actually send a notification, use the
address provided by the module:
view : Html -> Html view notifications = let controls = button [onClick Notification.address (Notification.info "Elm rocks!")] [text "Go"] in div  [notifications, controls]