svelte-toast icon indicating copy to clipboard operation
svelte-toast copied to clipboard

Toast icon

Open rawan-bekheet opened this issue 2 years ago • 5 comments

Added the ability to add icons and/or images to the right of the toast message

rawan-bekheet avatar Feb 28 '23 01:02 rawan-bekheet

Thanks for the PR - but my first thought is images can already be shown by passing HTML into msg? Something like this: https://svelte.dev/repl/9973db692dbc442599829b7e3babbc64?version=3.55.1

zerodevx avatar Feb 28 '23 08:02 zerodevx

We thought about this with my team, and we thought adding it as an out of the box feature would be more convenient. But if it doesn't align with your vision for the library we could cancel the PR. Cheers!

rawan-bekheet avatar Feb 28 '23 15:02 rawan-bekheet

I think we can leave this here and gather some feedback for now. I kind of feel that in the current iteration of svelte-toast, the view and logic are too tightly-coupled - something that I hope to fix in the next major.

zerodevx avatar Mar 01 '23 12:03 zerodevx

I think this is a good approach. If we need to pass the HTML into msg, then we need to pass the image in each toast.push. Instead, if we have it in the options we can set an icon during initialization.

AnweshGangula avatar Jan 09 '24 08:01 AnweshGangula