Skip to content

Toast icon - #69

Open
rawan-bekheet wants to merge 2 commits into
zerodevx:masterfrom
rawan-bekheet:toastIcon
Open

rawan-bekheet wants to merge 2 commits into
zerodevx:masterfrom
rawan-bekheet:toastIcon

Conversation

@rawan-bekheet

Copy link
Copy Markdown

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

@zerodevx

Copy link
Copy Markdown
Owner

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

@rawan-bekheet

Copy link
Copy Markdown
Author

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!

@zerodevx

zerodevx commented Mar 1, 2023

Copy link
Copy Markdown
Owner

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.

@AnweshGangula

AnweshGangula commented Jan 9, 2024

Copy link
Copy Markdown

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.

@ronny-rentner

Copy link
Copy Markdown

I use an icon library (Iconify), so for me, it wouldn't be helpful. Though, it would be easy to create a local wrapper component that adds icons to the msg using whatever icon library the project is using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants