Docs

Documentation versions (currently viewingVaadin 25)
Documentation translations (currently viewingEnglish)

Notification Styling

Styling API reference for the Notification component.

Style Variants

Notification supports the following style variants.

Variant Description Supported by

primary

Used for important informational messages or to draw extra attention

Lumo

success

Used to display success messages

Lumo

warning

Used to display warnings

Lumo

error

Used to display errors

Lumo

contrast

Used to distinguish the notification from the rest of the UI

Lumo

Success

The success variant can be used to display success messages, such as when a task or operation is completed.

Source code
NotificationSuccess.java
notification-success.tsx
notification-success.ts

Users shouldn’t be notified always, or even frequently, of successful operations. Too many notifications can be more distracting than helpful to users. Use success notifications only for operations whose successful completion may otherwise be difficult to discern.

Warning

The warning variant can be used to display warnings.

Source code
NotificationWarning.java
notification-warning.tsx
notification-warning.ts

Warning notifications should be persistent, and provide the user with a button that closes the notification or allows the user to take appropriate action.

Error

The error variant can be used to display errors.

Source code
NotificationError.java
notification-error.tsx
notification-error.ts

Error notifications should be persistent, and provide the user with a button that closes the notification or allows the user to take appropriate action.

Notifications are non-modal and can be ignored. Therefore, they’re usually inappropriate for displaying unexpected technical errors that prevent the application from functioning, or situations that require immediate user action. Use instead a modal Dialog in such situations.

The built-in error message feature, included with input field components, should be used for field-specific input validation errors.

Primary

The primary variant can be used for important informational messages or to draw extra attention to a notification.

Source code
NotificationPrimary.java
notification-primary.tsx
notification-primary.ts

Contrast

The contrast variant can improve legibility and distinguish the notification from the rest of the UI.

Source code
NotificationContrast.java
notification-contrast.tsx
notification-contrast.ts

Style Properties

The following style properties can be used in CSS stylesheets to customize the appearance of this component.

To apply values to these properties globally in your application UI, place them in a CSS block using the html {…​} selector. See Component Style Properties for more information on style properties.

Notification Card Properties

The following properties apply to the vaadin-notification-card element:

Property Supported by

--vaadin-notification-background

Aura

--vaadin-notification-border-color

Aura

--vaadin-notification-border-radius

Aura

--vaadin-notification-border-width

Aura

--vaadin-notification-padding

Aura

--vaadin-notification-shadow

Aura

--vaadin-notification-width

Aura

Notification Container Properties

The following properties apply to the vaadin-notification-container element:

Property Supported by

--vaadin-notification-container-gap

Aura

--vaadin-notification-viewport-inset

Aura

CSS Selectors

The following CSS selectors can be used in stylesheets to target the various parts and states of the component. See the Styling documentation for more details on how to style components.

Root element

vaadin-notification-card

Parts

Notification card

vaadin-notification-card::part(overlay)

Content wrapper

vaadin-notification-card::part(content)