react-toastify icon indicating copy to clipboard operation
react-toastify copied to clipboard

Custom icon

Open BloodhoundAllfather opened this issue 8 years ago • 2 comments

Hello, First of all thank you for your awesome library. It would be very good to be able to add custom icon for notification. At least if we can enter 2 texts with different fonts, we can use the first one as icon and second one as message. Thanks, Best wishes

BloodhoundAllfather avatar Oct 24 '18 08:10 BloodhoundAllfather

Hey @MChelik,

Thanks, glad you like it.

You can render any react component. So for your use case you could do

const Foo = () => (
<div>
<span>🦄</span>
<div className="classWithFontStyleOrWhatever">Hello</div>
</div>
)

//somewhere else
toast(<Foo />)

Is It what you are looking for? More details here

fkhadra avatar Oct 25 '18 11:10 fkhadra

Oh right. Thank you very much.

BloodhoundAllfather avatar Oct 25 '18 13:10 BloodhoundAllfather