Renamed to panthershark/snackbar-old. That is where the repository lives now. It has not been published as a package under the new name.
Versions published as doanythingfordethklok/snackbar still install under that name. 1 version of 1 come from the new location (see their notes).
Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/panthershark/snackbar-old.
What we checked: The repo moved to github.com/panthershark/snackbar-old. Rebuilt with git archive from commit cf11f6efeebe of https://github.com/panthershark/snackbar-old (zip prefix doanythingfordethklok-snackbar-cf11f6e/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 44d149c85c8d906847e1349d84a9f6c612a6ea41.
The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.
Details · package.elm-lang.org's zip: https://github.com/doanythingfordethklok/snackbar/zipball/1.0.0/
A material design snackbar written in elm. See the demo
According to Material spec, snackbars should hide themselves. Allowing them to be closed is int he Caution section. We support both options.
To accomplish this and keep consurrent timeouts staight, use the factory functions.
Assume a setup like:
import Snackbar exposing (Snackbar)
type alias Model = {
snackbar: Snackbar
}
type Msg =
SnackMessage (Snackbar.Msg Msg)
| CustomAction
update msg model =
case msg of
SomeAppMessage ->
let
( sb, cmd ) =
Snackbar.message (Snackbar.DefaultDelay) "Hello World!"
in
( { model | snackbar = sb }, Cmd.map SnackMessage cmd )
CustomAction ->
(model, doSomething)Snackbar.message (Snackbar.CustomDelay 8000) "I'm a plain message that disappears in 8s."Snackbar.link (Snackbar.CustomDelay 8000) "I'm a message with a link to a url" "YO" "http://giphy.com"In this case, the action_ref is passed to the Snackbar.Msg of ButtonClick action_ref. Using this action_ref, an application that could handle multiple actions can distinguish events/intent from different snackbars.
Snackbar.action (Snackbar.CustomDelay 8000) "I'm a message that triggers an action in the app" "WOAH" CustomActionSnackbar.message Snackbar.ShowForever "I'm a plain message that won't go away until explcitly."From here - https://material.io/design/components/snackbars.html#behavior
Snackbars appear without warning, and don't require user interaction. They automatically disappear from the screen after a minimum of four seconds, and a maximum of ten seconds.
Snackbar.ShowForeverSnackbar.CustomDelay 6000Snackbar.DefaultDelaySnackbar.message default hides after 4sSnackbar.action default hides after 10sSnackbar.link default hides after 10s