kbrgl / svelte-french-toast

🍞🥂 Buttery smooth toast notifications for Svelte
https://svelte-french-toast.vercel.app/
MIT License
809 stars 28 forks source link

Request for Feature: More Granular Toast Positioning #24

Open YugoCode opened 1 year ago

YugoCode commented 1 year ago

First of all, thank you very much for this great component! :)

Currently, the svelte-french-toast library positions toasts with a default "fixed" positioning, which centers them relative to the entire screen. However, in some cases, it might be desirable to center the toasts relative to a specific section of the page, such as a content area in a two-column layout (sidebar - content).

Is this already somehow possible?

If not, here are two ideas for implementing it:

  1. Allow users to set the positioning of the toasts to either "fixed" or "absolute". This would give users the ability to control the centering of the toasts by placing the toaster in a specific place.

<Toaster position="absolute" />

  1. Allow users to specify an offset, such as "offset-left: 250px". This would give users the ability to fine-tune the positioning of the toasts to their liking.

<Toaster offsetLeft="250px"/>