Notification Menu
Notification Menu
Notification Menu. Provides badge counter and actions view all and mark all as read.
Sample code
static final List<NotificationItem> items = new ArrayList<NotificationItem>() {{ add(new NotificationItem(NotificationType.INFO, "Movie Release", "John Wick 4 is coming soon!")); add(new NotificationItem(NotificationType.SUCCESS, "Movie Release", "The Matrix Resurrections is coming soon!")); }}; final NotificationMenu notificationMenu = new NotificationMenu(); notificationMenu.setItems(items); notificationMenu.addItemClickEventListener(event -> { final NotificationItem selectedItem = event.getSelectedItem(); Notification.show(selectedItem.getDescription(), 5000, Notification.Position.TOP_END).open(); final int index = items.indexOf(selectedItem); items.get(index).markAsRead(); notificationMenu.setItems(items); }); notificationMenu.addViewAllClickEventListener(event -> { Notification.show("Option 'View all' clicked!", 5000, Notification.Position.TOP_END).open(); }); notificationMenu.addMarkAllAsReadClickEventListener(event -> { Notification.show("Option 'Mark all as read' clicked!", 5000, Notification.Position.TOP_END).open(); items.forEach(NotificationItem::markAsRead); notificationMenu.setItems(items); });
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
- Added support for custom icons.
- Added support for i18n.
- Added support for max. limit of items.
- Added methods to hide header, and footer actions.
- Provides methods to update a subset of items.
- Released
- 2023-04-25
- Maturity
- STABLE
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 14
- Vaadin 22
- Vaadin 23
- Browser
- Firefox
- Safari
- Google Chrome
Notification Menu - Vaadin Add-on Directory
Notification MenuNotification Menu. Provides badge counter and actions view all and mark all as read.
View on GitHubNotification Menu version 1.0.3
Notification Menu version 1.0.4
Fix paper-dialog scrollbar for Firefox.
Hidden scrollbar to better experience.
Notification Menu version 1.0.5
Update to latest stable vaadin version 14.8.3.
Notification Menu version 1.0.6
* Added support for custom icons.
* Added support for i18n.
* Added support for max. limit of items.
* Added methods to hide header, and footer actions.
* Provides methods to update a subset of items.