Show a notification with an action
const comment = () => {
const uuid = TemporaryNotification.show(
"Edna Mode commented on your assigned case.",
{
actionText: "View",
action: () => {
TemporaryNotification.dismiss(uuid);
}
}
);
};<GoabTemporaryNotificationCtrl />
<GoabButton onClick={comment}>Comment</GoabButton>Show a temporary notification with an action button for user interaction.
When to use
Use this pattern when:
- Users need to take action in response to a notification
- Providing a quick way to navigate to related content
- Showing activity notifications that users may want to respond to
- The action should dismiss the notification when clicked
Considerations
- Use
actionTextto set the button label in the notification - The
actioncallback receives the notification UUID for dismissal - Use
TemporaryNotification.dismiss(uuid)to close the notification programmatically - Keep action text short and clear (e.g., “View”, “Undo”, “Open”)
- Consider what happens if the user doesn’t click the action before auto-dismiss