Create an alert panel in server code to be displayed in the specified UI selector location
createPSAlert(
session = shiny::getDefaultReactiveDomain(),
id = NULL,
selector = NULL,
options
)
Shiny session object
Anchor id (either id or selector only should be set)
Character vector represents jQuery selector to add the alert to is (i.e ".alertClass", div.badge-danger.navbar-badge). If 'id' is specified, this parameter will be neglected
List of options to pass to the alert
html div and inserts it in the app DOM
Call this function from program/server_local.R
or any other server file to setup the needed alert
library(shiny)
library(bs4Dash)
# Inside server_local.R
createPSAlert(id = "sidebarRightAlert",
options = list(title = "Right Side",
status = "success",
closable = TRUE,
content = "Example Basic Sidebar Alert"))
# Test se
## a div with class "badge-danger.navbar-badge" must be exist in UI to display alert
selector <- "div.badge-danger.navbar-badge"
createPSAlert(selector = selector,
options = list(title = "Selector Title",
status = "danger",
closable = TRUE,
content = "Selector Alert"))