Bulma study case: Creating Custom Handler

  1. Adding JS dependency.
create_dependency("@vizuaalog/bulmajs", "0.12.2")
  1. Defining the structure for the notification.
create_custom_handler("notification")
notification-handler.R notification.js
send_notification_message <- function(
  id = NULL,
  options = NULL,
  session = shiny::getDefaultReactiveDomain()
) {
 message <- list(
  # your logic
 )

 session$sendCustomMessage(type = "notification",
                           message)
}
$(function() {
  Shiny.addCustomMessageHandler(
    'notification', function(message) {
       Bulma('body').notification({
         body: 'Example notification',
         color: 'info'
       }).show();
  });
});