Skip to content
Version:

Install ​

Maven ​

xml
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-notification-flow</artifactId>
</dependency>

Import ​

java
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.notification.Notification.Position;
import com.vaadin.flow.component.notification.NotificationVariant;

Variants ​

Information ​

java
Notification notification = new Notification("Sie verwenden nun die Softwareversion 2.0.", 5000);
notification.setPosition(Position.TOP_CENTER);
notification.open();

Success ​

java
Notification notification = new Notification("Der Datensatz wurde gespeichert.", 5000);
notification.addThemeVariants(NotificationVariant.LUMO_SUCCESS);
notification.setPosition(Position.TOP_CENTER);
notification.open();

Warning ​

java
Notification notification = new Notification("Ihr Passwort läuft in 5 Tagen ab.", 5000);
notification.addThemeVariants(NotificationVariant.LUMO_WARNING);
notification.setPosition(Position.TOP_CENTER);
notification.open();

Error ​

java
Notification notification = new Notification("Der Datensatz konnte nicht gespeichert werden.", 0);
notification.addThemeVariants(NotificationVariant.LUMO_ERROR);
notification.setPosition(Position.TOP_CENTER);
notification.open();