timolins / react-hot-toast

Smoking Hot React Notifications 🔥
https://react-hot-toast.com
MIT License
9.79k stars 331 forks source link

toast text alignment #136

Closed ATakaSKY closed 2 years ago

ATakaSKY commented 2 years ago

I want the toast text to be left aligned instead of center, this is what I'm trying to do:

toast('My toast.', {
              duration: 2000,
              position: 'bottom-center',
              style: {
                background: '#ccc',
                width: '300px',
                textAlign: 'left',
              },
              icon: '😀',
            });

What this ends up creating is this:

image

What I instead want is:

image

Is there some way to make this work

timolins commented 2 years ago

You can find two possible solutions here: https://github.com/timolins/react-hot-toast/issues/88#issuecomment-863131815

If this is something more people want, we can think about exposing an API for that.

ATakaSKY commented 2 years ago

While this fixes the issue, I'd still like it to have customisations like width, text alignment etc., those will be good to have