SCION Workbench | Projects Overview | Changelog | Contributing | Sponsoring |
---|
SCION Workbench > How To Guides > Notification
A notification is a closable message that appears in the upper-right corner and disappears automatically after a few seconds. It informs the user of a system event, e.g., that a task has been completed or an error has occurred. Multiple notifications are stacked vertically. Notifications can be grouped. For each group, only the last notification is displayed.
To show a notification, inject NotificationService
and invoke the notify
method, passing a Notification
options object to control the appearance of the notification, like its severity, its content and show duration.
import {inject} from '@angular/core';
import {NotificationService} from '@scion/workbench';
const notificationService = inject(NotificationService);
notificationService.notify({
content: 'Person successfully created',
severity: 'info',
duration: 'medium',
});
To display structured content, consider passing a component to NotificationConfig.content
instead of plain text.