Granite Alert
Vaadin global notifications (wrapper for https://github.com/LostInBrittany/granite-alert with themable support)
GraniteAlert is a container for other components, which are rendered inside the alert, and can be used as a way of displaying a global notification. The property level maps to the level attribute of granite-alert, with each level (info, warning, error and success) providing a different style. The property compact enables additional style rules that reduce spacing around the content.
It is also posible to injecting styles directly into the granite-alert shadow DOM, by using style modules (see examples)
Sample code
GraniteAlert alert = new GraniteAlert(); alert.setCompact(true); alert.setLevel(GraniteAlertLevel.SUCCESS); alert.add(new Span("Success!"));
<dom-module id="custom-granite-alert-theme" theme-for="granite-alert"> <template> <style> :host(.custom) .alert { color: var(--lumo-body-text-color); background-color: white; border-color: grey; } </style> </template> </dom-module>
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Initial release
- Released
- 2019-01-21
- Maturity
- TESTED
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 10
- Vaadin 11
- Vaadin 12
- Vaadin 13
- Vaadin 14+ in 2.0.0
- Browser
- Browser Independent
Vaadin Add-on Directory
Find open-source widgets, add-ons, themes, and integrations for your Vaadin application.