Open dreamorosi opened 2 years ago
Thanks @dreamorosi for the detailed request! Yes, like you mentioned there is a lot of cross over between the pinpoint functionality so we might find that at least the UI portion is re-usable to achieve a lot of this. I will definitely bring this up with the team.
On which framework/platform would you like to see this feature implemented?
React
Which UI component is this feature-request for?
Other
Please describe your feature-request in detail.
I would like to propose a new Toast feature that would allow customers to display a notification (a.k.a. toast) on screen. This would not be a connected component and would be used for purely frontend-related notifications (i.e. An error occurred, message sent successfully).
With this component being provided by Amplify UI customers could avoid to have to implement their own component / system and thus reduce boilerplate code. This component would leverage the existing Hub utility to allow user to send toasts from any component in their app.
Having this component would allow customers to make their applications more engaging as displaying notifications that provide context to end users as result of an action is a common pattern in modern apps.
Please describe a solution you'd like.
Below an high-level and non-exhaustive example of how the feature could be implemented in Amplify UI:
Toast
component (you might already have this one for the Pinpoint-related features)notifications
ortoasts
) and renders a newToast
component (using a list/set given that there might be multiple toasts at any time on screen). This component is also in charge of removing a toast after it expires (as defined by theduration
props).Below instead an example of how customers could use the feature to send a notification, there are two pieces to it:
ToastContext
from Amplify UI, this component should be used high in the tree and wrap the appHub
fromaws-amplify
to send a notification/create a toastWe love contributors! Is this something you'd be interested in working on?