Description Usage Arguments Examples
Builtin AdminLTE3 toasts
1 2 3 4 5 6 7 |
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. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 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.