Closed boptom closed 8 months ago
Yes, that would be nice, and it would be even better with some specific Sonner functions to cover the Sonner API better. In some cases, it would be nice to be able to control for example the duration
of the Sonner toast. Currently, you'd have to handle all that client-side, but that becomes more cumbersome if you adapt a root.tsx approach for the Toast component because you'd have to switch the config for the toast based on the origin or content of the message, which feels hacky.
Or going back, re-using existing methods, an option fourth parameter could be used to pass along an object, that can then be consumed in the loader data and used for configuration. In theory that can be done now using the headers, but this also seems hacky at best. This would enable you to pass along runtime configuration to any client-side toast library. It would be pretty straightforward to add and non-breaking.
What do you think @AlemTuzlak?
Any chance of getting an optional
description
field inToastMessage
? This will allow descriptions in Sonner.See here: https://sonner.emilkowal.ski/toast#api-reference
I believe it would require an additional field here: https://github.com/Code-Forge-Net/remix-toast/blob/main/src/schema.ts#L3
Thanks!