srcrip / live_toast

A beautiful drop-in replacement for the Phoenix Flash system.
https://toast.src.rip
MIT License
193 stars 17 forks source link

Request: `:top_center` and `:bottom_center` #2

Open sodapopcan opened 6 months ago

sodapopcan commented 6 months ago

My current toasts show up in the bottom centre. Obviously this isn't super desirable if you have multiple toasts, though my project doesn't need them (I'm more after the auto-hiding).

srcrip commented 6 months ago

Will do! Sonner has this option and I would like to have it as well.

sergchernata commented 5 months ago

@srcrip do you need a PR for this or are you already working on it?

srcrip commented 4 months ago

Hi @sergchernata,

I can knock it out quickly, but I'm working on a few higher priority issues that are more complex first so if you would like to make a PR it will be appreciated too!

sergchernata commented 3 months ago

I ended up just wrapping the LiveToast component into a div and positioning that in the center.

<div class="absolute bottom-0 left-1/2 -translate-x-1/2">
  <LiveToast.toast_group flash={@flash} connected={assigns[:socket] != nil} toast_class_fn={&Front.Helpers.toast_class_fn/1} />
</div>
srcrip commented 2 months ago

No worries, I will still make the change requested I've just been caught up with a few other things + thinking about one big change to the lib itself thats taking up my time.