toast | R Documentation |
Builtin AdminLTE3 toasts
toast(
title,
body = NULL,
subtitle = NULL,
options = NULL,
session = shiny::getDefaultReactiveDomain()
)
title |
Toast title. |
body |
Body content. |
subtitle |
Toast subtitle. |
options |
Toasts options: a list. See https://adminlte.io/docs/3.0/javascript/toasts.html. |
session |
Shiny session object. |
if (interactive()) {
library(shiny)
library(bs4Dash)
shinyApp(
ui = dashboardPage(
header = dashboardHeader(),
sidebar = dashboardSidebar(),
body = dashboardBody(
actionButton("sendToast", "Send Toast")
),
controlbar = dashboardControlbar(),
title = "Toasts"
),
server = function(input, output) {
observeEvent(input$sendToast, {
toast(
title = "My Toast",
body = h4("I am a toast!"),
options = list(
autohide = TRUE,
icon = "fas fa-home",
close = FALSE
)
)
})
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.