Announcing Live Toast: a replacement toast/flash component for Phoenix LiveView, heavily inspired by the look of Sonner (the amazing toast component for React).
I’ve been cooking this up for a while. It’s still pre-1.0, but the general API should be solid.
My biggest gripe with the default flash system in Phoenix is that you may only have one toast for a given severity level. No more! Now you can use Live Toast to get around this, but it will also continue to render your flash messages in the same style so you can incrementally move towards the toasts instead.
As I said, its still early days so let me know if you find any problems.
This is great! It looked promising when you first mentioned it and I’m into the further work you’ve done.
I’m in the processes of converting a project over to it. A couple of problems off the bat which are only related to docs: you aren’t properly indenting the @doc examples so they aren’t rendering as code in Hexdocs. The code link (</>) is also broken in a bunch (possibly all) places. Not sure why that one is.
Lastly: I would love a :bottom_center option (and of course probably include :top_center) as that’s what I’m currently using. Happy to send a PR.
Oh, also while it’s fairly obvious, the docs mention using the put_toast helper without any instructions on how to import it.
Oh I figured that out, just nice to include in the docs as it’s not 100% clear and causes a bit of mental dissonance Or even like just put LiveToast.put_toast so it’s super obvious it’s not in a submodule or something. I just appreciate idiot-proof docs
PS: Client project has been converted to LiveToast and it’s working like a charm