Is there a way to enable Sweet Alerts in Retool? utils.showNotification definitely helps in the meantime but if it's possible to add Sweet Alerts it would be nice
Hey @kelvin-reyes!
Imported JavaScript libraries run in a sandbox that doesn't have access to the top-level window or document, because of that I'm not sure there's a way to have them show notifications and other popups in the normal flow of an app.
It's possible to include this in a custom component for example, but then the popup only exists in that iframe You could combine that with a modal or so to maybe get some of the functionality you're looking for - is there anything in particular that you'd like from Sweet Alerts?
Nothing in particular. It's just that it's more fancy and intuitive when it comes to UI/UX
Ah! In that case you might be able to do something more immediately by using a modal to show notifications. You can add a any Retool components to the modal and open it programmatically either using a "Control component" event handler:
Or using yourModal.open()
and yourModal.close()
in any scripts your run.
It's not as fancy but hopefully it can work as an approximation within your use case.