Create a notification box https://bulma.io/documentation/elements/notification/.
bulmaNotification(
id = NULL,
options = NULL,
session = shiny::getDefaultReactiveDomain()
)
Notification target. It will be attached on the provided DOM element. If id is NULL, the notification is attached to the body.
A list of notification options. See https://github.com/VizuaaLOG/BulmaJS.
A valid shiny session.
if (interactive()) {
library(shiny)
ui <- bulmaPage(
bulmaActionButton("show_notif", "Show notification"),
div(id = "target", style = "top: 0px; right: 0px; position: absolute;")
)
server <- function(input, output, session) {
observeEvent(input$show_notif, {
bulmaNotification(
id = "target",
options = list(
body = "This is the message",
color = "info",
dismissInterval = 200000,
isDismissable = TRUE
)
)
})
}
shinyApp(ui, server)
}